Data Fields in Payload CMS

Data Fields are used to store data in the Database. All Data Fields have a name property. This is the key that will be used to store the field’s value.

Here are the available Data Fields:

  • Array – for repeating content, supports nested fields
  • Blocks – for block-based content, supports nested fields
  • Checkbox – saves boolean true / false values
  • Code – renders a code editor interface that saves a string
  • Date – renders a date picker and saves a timestamp
  • Email – ensures the value is a properly formatted email address
  • Group – nests fields within a keyed object
  • JSON – renders a JSON editor interface that saves a JSON object
  • Number – saves numeric values
  • Point – for location data, saves geometric coordinates
  • Radio – renders a radio button group that allows only one value to be selected
  • Relationship – assign relationships to other collections
  • Rich Text – renders a fully extensible rich text editor
  • Select – renders a dropdown / picklist style value selector
  • Tabs (Named) – similar to group, but renders nested fields within a tabbed layout
  • Text – simple text input that saves a string
  • Textarea – similar to text, but allows for multi-line input
  • Upload – allows local file and image upload

Presentational Fields

Presentational Fields do not store data in the database. Instead, they are used to organize and present other fields in the Admin Panel, or to add custom UI components.

Here are the available Presentational Fields:

  • Collapsible – nests fields within a collapsible component
  • Join – achieves two-way data binding between fields
  • Row – aligns fields horizontally
  • Tabs (Unnamed) – nests fields within a tabbed layout
  • UI – blank field for custom UI components

Leave a comment

Your email address will not be published. Required fields are marked *