Adds a blockSettingsField helper that groups secondary fields of a block behind a Settings toggle in the block header. Settings can show inline in the block body or open in a drawer. Multiple settings fields on one block are merged into a single group during plugin initialization. Requires Payload 3 and registering the plugin in the config.
Utilities for configuring and composing Payload block settings.
Installation
npm i @whatworks/payload-block-settings16
Stars
1
Forks
2
Open Issues
3 days ago
Last Updated
163
Weekly Downloads
v2.0.2
npm Version
59.4 KB
Unpacked Size
0
Dependencies
16+1 since Sep 7
| Date | Stars |
|---|---|
| Dec 6, 2026 | 16 |
| Dec 5, 2026 | 16 |
| Dec 4, 2026 | 16 |
| Dec 3, 2026 | 16 |
| Dec 2, 2026 | 16 |
| Dec 1, 2026 | 16 |
| Nov 30, 2026 | 16 |
| Nov 29, 2026 | 16 |
| Nov 28, 2026 | 16 |
| Nov 27, 2026 | 16 |
| Nov 26, 2026 | 16 |
| Nov 25, 2026 | 16 |
| Nov 24, 2026 | 16 |
| Nov 23, 2026 | 16 |
| Nov 22, 2026 | 16 |
| Nov 21, 2026 | 16 |
| Nov 20, 2026 | 16 |
| Nov 19, 2026 | 16 |
| Nov 18, 2026 | 16 |
| Nov 17, 2026 | 15 |
| Nov 16, 2026 | 15 |
| Nov 15, 2026 | 15 |
| Nov 14, 2026 | 15 |
| Nov 13, 2026 | 15 |
| Nov 12, 2026 | 15 |
| Nov 11, 2026 | 15 |
| Nov 10, 2026 | 15 |
| Nov 9, 2026 | 15 |
| Nov 8, 2026 | 15 |
| Nov 7, 2026 | 15 |
| Nov 6, 2026 | 15 |
| Nov 5, 2026 | 15 |
| Nov 4, 2026 | 15 |
| Nov 3, 2026 | 15 |
| Nov 2, 2026 | 15 |
| Nov 1, 2026 | 15 |
| Oct 31, 2026 | 15 |
| Oct 30, 2026 | 15 |
| Oct 29, 2026 | 15 |
| Oct 28, 2026 | 15 |
| Oct 27, 2026 | 15 |
| Oct 26, 2026 | 15 |
| Oct 25, 2026 | 15 |
| Oct 24, 2026 | 15 |
| Oct 23, 2026 | 15 |
| Oct 22, 2026 | 15 |
| Oct 21, 2026 | 15 |
| Oct 20, 2026 | 15 |
| Oct 19, 2026 | 15 |
| Oct 18, 2026 | 15 |
| Oct 17, 2026 | 15 |
| Oct 16, 2026 | 15 |
| Oct 15, 2026 | 15 |
| Oct 14, 2026 | 15 |
| Oct 13, 2026 | 15 |
| Oct 12, 2026 | 15 |
| Oct 11, 2026 | 15 |
| Oct 10, 2026 | 15 |
| Oct 9, 2026 | 15 |
| Oct 8, 2026 | 15 |
| Oct 7, 2026 | 15 |
| Oct 6, 2026 | 15 |
| Oct 5, 2026 | 15 |
| Oct 4, 2026 | 15 |
| Oct 3, 2026 | 15 |
| Oct 2, 2026 | 15 |
| Oct 1, 2026 | 15 |
| Sep 30, 2026 | 15 |
| Sep 29, 2026 | 15 |
| Sep 28, 2026 | 15 |
| Sep 27, 2026 | 15 |
| Sep 26, 2026 | 15 |
| Sep 25, 2026 | 15 |
| Sep 24, 2026 | 15 |
| Sep 23, 2026 | 15 |
| Sep 22, 2026 | 15 |
| Sep 21, 2026 | 15 |
| Sep 20, 2026 | 15 |
| Sep 19, 2026 | 15 |
| Sep 18, 2026 | 15 |
| Sep 17, 2026 | 15 |
| Sep 16, 2026 | 15 |
| Sep 15, 2026 | 15 |
| Sep 14, 2026 | 15 |
| Sep 13, 2026 | 15 |
| Sep 12, 2026 | 15 |
| Sep 11, 2026 | 15 |
| Sep 10, 2026 | 15 |
| Sep 9, 2026 | 15 |
| Sep 8, 2026 | 15 |
| Sep 7, 2026 | 15 |
Shared by 12 plugins in what-works-global/payload-packages.
210+196 since Sep 7
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 210 |
| Dec 5, 2026 | 243 |
| Dec 4, 2026 | 290 |
| Dec 3, 2026 | 258 |
| Dec 2, 2026 | 263 |
| Dec 1, 2026 | 324 |
| Nov 30, 2026 | 343 |
| Nov 29, 2026 | 297 |
| Nov 28, 2026 | 263 |
| Nov 27, 2026 | 212 |
| Nov 26, 2026 | 214 |
| Nov 25, 2026 | 245 |
| Nov 24, 2026 | 227 |
| Nov 23, 2026 | 214 |
| Nov 22, 2026 | 251 |
| Nov 21, 2026 | 247 |
| Nov 20, 2026 | 327 |
| Nov 19, 2026 | 291 |
| Nov 18, 2026 | 356 |
| Nov 17, 2026 | 353 |
| Nov 16, 2026 | 366 |
| Nov 15, 2026 | 373 |
| Nov 14, 2026 | 419 |
| Nov 13, 2026 | 387 |
| Nov 12, 2026 | 388 |
| Nov 11, 2026 | 324 |
| Nov 10, 2026 | 336 |
| Nov 9, 2026 | 328 |
| Nov 8, 2026 | 286 |
| Nov 7, 2026 | 242 |
| Nov 6, 2026 | 220 |
| Nov 5, 2026 | 220 |
| Nov 4, 2026 | 196 |
| Nov 3, 2026 | 159 |
| Nov 2, 2026 | 149 |
| Nov 1, 2026 | 151 |
| Oct 31, 2026 | 142 |
| Oct 30, 2026 | 115 |
| Oct 29, 2026 | 85 |
| Oct 28, 2026 | 40 |
| Oct 27, 2026 | 32 |
| Oct 26, 2026 | 32 |
| Oct 25, 2026 | 29 |
| Oct 24, 2026 | 23 |
| Oct 23, 2026 | 15 |
| Oct 22, 2026 | 19 |
| Oct 21, 2026 | 25 |
| Oct 20, 2026 | 24 |
| Oct 19, 2026 | 25 |
| Oct 18, 2026 | 36 |
| Oct 17, 2026 | 80 |
| Oct 16, 2026 | 109 |
| Oct 15, 2026 | 134 |
| Oct 14, 2026 | 137 |
| Oct 13, 2026 | 134 |
| Oct 12, 2026 | 134 |
| Oct 11, 2026 | 143 |
| Oct 10, 2026 | 105 |
| Oct 9, 2026 | 100 |
| Oct 8, 2026 | 74 |
| Oct 7, 2026 | 65 |
| Oct 6, 2026 | 63 |
| Oct 5, 2026 | 67 |
| Oct 4, 2026 | 44 |
| Oct 3, 2026 | 48 |
| Oct 2, 2026 | 25 |
| Oct 1, 2026 | 37 |
| Sep 30, 2026 | 45 |
| Sep 29, 2026 | 47 |
| Sep 28, 2026 | 48 |
| Sep 27, 2026 | 49 |
| Sep 26, 2026 | 41 |
| Sep 25, 2026 | 40 |
| Sep 24, 2026 | 26 |
| Sep 23, 2026 | 25 |
| Sep 22, 2026 | 22 |
| Sep 21, 2026 | 22 |
| Sep 20, 2026 | 26 |
| Sep 19, 2026 | 31 |
| Sep 18, 2026 | 35 |
| Sep 17, 2026 | 37 |
| Sep 16, 2026 | 33 |
| Sep 15, 2026 | 37 |
| Sep 14, 2026 | 36 |
| Sep 13, 2026 | 30 |
| Sep 12, 2026 | 23 |
| Sep 11, 2026 | 21 |
| Sep 10, 2026 | 22 |
| Sep 9, 2026 | 22 |
| Sep 8, 2026 | 18 |
| Sep 7, 2026 | 14 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1064440892-block-settings)<a href="https://payloaddirectory.dev/plugins/1064440892-block-settings"><img src="https://payloaddirectory.dev/badge/1064440892-block-settings.svg" alt="Payload Directory"></a>README
Hide extra fields for blocks behind a visibility toggle button.
pnpm add @whatworks/payload-block-settings
import { buildConfig } from 'payload'
import { blockSettingsField, blockSettingsPlugin } from '@whatworks/payload-block-settings'
export default buildConfig({
collections: [
{
slug: 'pages',
fields: [
{
name: 'components',
type: 'blocks',
blocks: [
{
slug: 'component',
fields: [
{
name: 'title',
type: 'text',
},
blockSettingsField({
fields: [
{
name: 'theme',
type: 'select',
options: ['light', 'dark'],
},
{
name: 'anchor',
type: 'text',
},
],
settings: {
location: 'drawer',
},
}),
blockSettingsField({
fields: [
{
name: 'variant',
type: 'select',
options: ['default', 'featured'],
},
],
settings: {
canonical: true,
location: 'inline',
},
}),
],
},
],
},
],
},
],
plugins: [blockSettingsPlugin()],
})
blockSettingsField() accepts normal Payload GroupField args. The only plugin-specific top-level addition is settings, which controls how that group participates in block settings behavior.
settings object| Key | Type | Default | Notes |
|---|---|---|---|
canonical | boolean | false | Marks this settings group as the canonical source of truth when multiple blockSettingsField() calls exist on the same block. More than one canonical settings group throws an error. |
location | 'inline' | 'drawer' | 'inline' | Controls whether the Settings button toggles the fields inline inside the block body or opens them in a drawer. |
The plugin replaces block.admin.components.Label with BlockSettingsLabel on any block that uses blockSettingsField(). To customize, point the block's Label at your own component — include BlockSettingsToggleButton so the settings toggle still renders.
{
slug: 'component',
admin: {
components: {
Label: '/path/to/MyBlockLabel#MyBlockLabel',
},
},
fields: [/* ... */],
}
Use BlockLabelWithActions to keep Payload's default row header and append extra buttons next to the settings toggle.
'use client'
import {
BlockLabelWithActions,
BlockSettingsToggleButton,
useBlockLabelState,
type BlockLabelActionComponent,
} from '@whatworks/payload-block-settings/client'
const MyCustomActionButton: BlockLabelActionComponent = (props) => {
const { path } = useBlockLabelState(props)
return <button onClick={() => console.log('duplicate', path)}>⧉</button>
}
export const MyBlockLabel: BlockLabelActionComponent = (props) => (
<BlockLabelWithActions {...props} actions={[BlockSettingsToggleButton, MyCustomActionButton]} />
)
For full control over markup, skip BlockLabelWithActions and read row state directly from useBlockLabelState. Render BlockSettingsToggleButton anywhere inside.
'use client'
import {
BlockSettingsToggleButton,
useBlockLabelState,
type BlockLabelActionComponent,
} from '@whatworks/payload-block-settings/client'
export const MyBlockLabel: BlockLabelActionComponent = (props) => {
const { block, resolvedRowNumber, rowLabel } = useBlockLabelState(props)
return (
<div className="my-block-label">
<span>#{resolvedRowNumber}</span>
<strong>{rowLabel}</strong>
<small>{block?.slug}</small>
<BlockSettingsToggleButton {...props} />
</div>
)
}
blockSettingsField() calls on the same block are merged into one real settings group during plugin initialization. If two merged top-level settings fields have the same name, the plugin throws an error. When groups are merged, the first tagged settings field becomes the canonical stored group unless one field is declared with settings: { canonical: true }, in which case that field becomes the source of truth. If more than one tagged settings field is marked settings: { canonical: true }, the plugin throws an error.settings.fields array.payload plugin presets
Save and apply reusable block configurations as presets from the Payload admin blocks drawer
786.7k/wk37v3
payload theme
shadcn-style redesign of the Payload admin with dashboard, command palette, dark mode and live theme customizer
751.8k/wk36v3
theme
Admin UI theme for Payload v4 with three styles and four palettes in light and dark
74343/wk10v4
payload plugin color theory
Build site and admin themes from color harmonies with WCAG contrast checks and an Auto, Light and Dark switch
74134/wk0v3
theme management
Theme presets, live preview and WCAG audit for editing site appearance from the Payload admin
73130/wk9v3
payload plugin stacked editing
Stacked, breadcrumb-navigated editing panels for nested blocks and arrays in the Payload admin
71250/wk37v3