Next
The Blocks Field is one of the most flexible tools in Payload. It stores an array of objects, where each object is a “block” with its own schema. Unlike a simple array (where every item looks the same), blocks let you mix and match different content types in any order.
This makes Blocks perfect for building dynamic, editor-friendly experiences, such as:
Quote, CallToAction, Slider, or Gallery.Text, Select, or Checkbox.Break, Presentation, or BreakoutSession. 
To add a Blocks Field, set the type to blocks in your Field Config:
This page is divided into two parts: first, the settings of the Blocks Field, and then the settings of the blocks inside it.
Option | Description |
|---|---|
| To be used as the property name when stored and retrieved from the database. More details. |
| Text used as the heading in the Admin Panel or an object with keys for each language. Auto-generated from name if not defined. |
| Array of block configs to be made available to this field. |
| Provide a custom validation function that will be executed on both the Admin Panel and the backend. More details. |
| A number for the fewest allowed items during validation when a value is present. |
| A number for the most allowed items during validation when a value is present. |
| If this field is top-level and nested in a config supporting Authentication, include its data in the user JWT. |
| Provide Field Hooks to control logic for this field. More details. |
| Provide Field Access Control to denote what users can see and do with this field's data. More details. |
| Restrict this field's visibility from all APIs entirely. Will still be saved to the database, but will not appear in any API response or the Admin Panel. |
| Provide an array of block data to be used for this field's default value. More details. |
| Enable localization for this field. Requires localization to be enabled in the Base config. If enabled, a separate, localized set of all data within this field will be kept, so there is no need to specify each nested field as |
| Enforce that each entry in the Collection has a unique value for this field. |
| Customize the block row labels appearing in the Admin dashboard. |
| Admin-specific configuration. More details. |
| Extension point for adding custom data (e.g. for plugins) |
| Override field type generation with providing a JSON schema |
| Provide |
* An asterisk denotes that a property is required.
To customize the appearance and behavior of the Blocks Field in the Admin Panel, you can use the admin option:
The Blocks Field inherits all of the default admin options from the base Field Admin Config, plus the following additional options:
Option | Description |
|---|---|
| Set the initial collapsed state |
| Disable order sorting by setting this value to |
If you're using this block within the Lexical editor, you can also customize how the block is rendered in the Lexical editor itself by specifying custom components.
admin.components.Label - pass a custom React component here to customize the way that the label is rendered for this blockadmin.components.Block - pass a component here to completely override the way the block is rendered in Lexical with your own componentThis is super handy if you'd like to present your editors with a very deliberate and nicely designed block "preview" right in your rich text.
For example, if you have a gallery block, you might want to actually render the gallery of images directly in your Lexical block. With the admin.components.Block property, you can do exactly that!
To import these utility components for one of your custom blocks, you can import the following:
Blocks are defined as separate configs of their own.
Option | Description |
|---|---|
| Identifier for this block type. Will be saved on each block as the |
| Array of fields to be stored in this block. |
| Customize the block labels that appear in the Admin dashboard. Auto-generated from slug if not defined. Alternatively you can use |
| Provide a custom image thumbnail URL to help editors identify this block in the Admin UI. The image will be displayed in a 3:2 aspect ratio container and cropped using |
| Customize this block's image thumbnail alt text. |
| Create a top level, reusable Typescript interface & GraphQL type. |
| Text to use for the GraphQL schema name. Auto-generated from slug if not defined. NOTE: this is set for deprecation, prefer |
| Custom table name for this block type when using SQL Database Adapter (Postgres). Auto-generated from slug if not defined. |
| Extension point for adding custom data (e.g. for plugins) |
* An asterisk denotes that a property is required.
When providing a custom thumbnail via imageURL, it's important to understand how images are displayed in the Admin UI to ensure they look correct.
Aspect Ratio and Cropping:
object-fit: cover, which means:Display Contexts:
Recommendations:
imageAltText for accessibilityExample:
If no imageURL is provided, a default placeholder graphic is displayed automatically.
Blocks are not fields, so they don’t inherit the base properties shared by all fields (not to be confused with the Blocks Field, documented above, which does). Here are their available admin options:
Option | Description |
|---|---|
| Custom component for replacing the Block, including the header. |
| Custom component for replacing the Block Label. |
| Hide the blockName field by setting this value to |
| Text or localization object used to group this Block in the Blocks Drawer. |
| Extension point for adding custom data (e.g. for plugins) |
Each block stores two pieces of data alongside your fields. The blockType identifies which schema to use and it is exactly the block’s slug. The blockName is an optional label you can give to a block to make editing and scanning easier.
The label is shared by all blocks of the same type and is defined in the block config via label with a fallback to slug. On the other hand, the blockName is specific to each block individually. You can hide the editable name with admin.disableBlockName.
If you provide admin.components.Label, that component replaces both the name and the label in the Admin UI.
Property | Scope | Source | Visible in UI | Notes |
|---|---|---|---|---|
| Each block | The block’s | Not a header | Used to resolve which block schema to render |
| Each block | Editor input in the Admin | Yes | Optional label; hide with |
| Block type | | Yes | Shared by all blocks of that type. Can be replaced with custom |
collections/ExampleCollection.js
If you have multiple blocks used in multiple places, your Payload Config can grow in size, potentially sending more data to the client and requiring more processing on the server. However, you can optimize performance by defining each block once in your Payload Config and then referencing its slug wherever it's used instead of passing the entire block config.
To do this, define the block in the blocks array of the Payload Config. Then, in the Blocks Field, pass the block slug to the blockReferences array - leaving the blocks array empty for compatibility reasons.
As you build your own Block configs, you might want to store them in separate files but retain typing accordingly. To do so, you can import and use Payload's Block type:
Blocks can be conditionally enabled using the filterOptions property on the blocks field. It allows you to provide a function that returns which block slugs should be available based on the given context.
filterOptions is re-evaluated as part of the form state request, whenever the document data changes.filterOptions, a validation error will occur when saving.In this example, the list of available blocks is determined by the enabledBlocks sibling field. If no value is set, all blocks remain available.