obsidian/wiki/payloadcms/fields-ui.md
2026-05-15 15:40:48 +01:00

2.6 KiB

title aliases tags sources created updated
UI Field
ui-field
presentational-field
payload-ui-field
payloadcms
fields
admin-panel
react
components
raw/fields__ui.md
2026-05-15 2026-05-15

Overview

The UI field is presentational-only — it stores no data and has no effect on documents. It lets you inject arbitrary React components directly into the Admin Panel, nested among your other fields.

import type { Field } from 'payload'

export const MyUIField: Field = {
  name: 'myCustomUIField',
  type: 'ui',
  admin: {
    components: {
      Field: '/path/to/MyCustomUIField',
      Cell: '/path/to/MyCustomUICell',
    },
  },
}

Config Options

Option Required Description
name Unique identifier for this field
label Human-readable label
admin.components.Field React component rendered in Edit View
admin.components.Cell React component rendered in List View cells
admin.disabled true to disable everywhere, or granular { field?, column?, filter?, groupBy?, bulkEdit? }
custom Extension point for plugin data

Default: UI fields have disabled: { bulkEdit: true } by default.

Use Cases

  • Descriptive text — add context/instructions between fields in Edit View
  • Action buttons — "Refund" button in Order sidebar, "Clear Cache" button, "View Page" shortcut
  • Custom controls — any React component injected exactly where editors need it

Key Takeaways

  • UI field has zero impact on stored data — purely admin UI enhancement
  • admin.components.Field is required (the component to render)
  • admin.components.Cell renders in List View columns — optional
  • Bulk edit is disabled by default (no data to edit)
  • Can trigger fetch calls, external APIs, or side effects from within the Admin Panel
  • Use wiki/payloadcms/fields-overview admin.condition to show/hide based on other field values

Sources