
Example uses:
Quote, CallToAction, Slider, Content, Gallery, or others.Text, Select, or Checkbox.Break, a Presentation, or a BreakoutSession.Option | Description |
|---|---|
| To be used as the property name when stored and retrieved from the database. More |
| 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 |
| 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-level hooks to control logic for this field. More |
| Provide field-level access control to denote what users can see and do with this field's data. More |
| 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 |
| 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. See below for more detail. |
| Extension point for adding custom data (e.g. for plugins) |
* An asterisk denotes that a property is required.
In addition to the default field admin config, you can adjust the following properties:
Option | Description |
|---|---|
| Set the initial collapsed state |
| Disable block order sorting by setting this value to |
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. |
| Provide a custom image thumbnail to help editors identify this block in the Admin UI. |
| Customize this block's image thumbnail alt text. |
| Create a top level, reusable Typescript interface & GraphQL type. |
| graphQL.singularName | Text to use for the GraphQL schema name. Auto-generated from slug if not defined. NOTE: this is set for deprecation, prefer interfaceName. | | dbName | 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) |
In addition to the field data that you define on each block, Payload will store two additional properties on each block:
blockType
The blockType is saved as the slug of the block that has been selected.
blockName
The Admin panel provides each block with a blockName field which optionally allows editors to label their blocks for better editability and readability.
collections/ExampleCollection.js
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: