Puck AI beta
Read docs
API ReferenceThemingFields

Fields

Use the following CSS properties for theming Puck’s fields.

.Container {
  --puck-field-radius: 32px;
  --puck-field-color-border: transparent;
  --puck-field-color-bg: #f0f0f0;
}

CSS properties

Defaults shown as var(--puck-...) reference global tokens. See computed values for the values they resolve to.

These apply to every field type; the sections below cover tokens specific to individual fields.

The -hover and -active variants only affect controls that respond to interaction, like selects, radio options, and array buttons. Plain text inputs change their border on hover, not their background.

TokenDefaultDescription
--puck-field-color-surfacevar(--puck-color-surface)Object / array body background
--puck-field-color-bgvar(--puck-color-surface)Field control background
--puck-field-color-bg-hovervar(--puck-color-interactive-soft-hover)Control background on hover
--puck-field-color-bg-activevar(--puck-color-interactive-soft)Active or selected background
--puck-field-color-textvar(--puck-color-text)Text color
--puck-field-color-text-hovervar(--puck-field-color-text)Text color on hover
--puck-field-color-text-activevar(--puck-color-interactive)Selected state text color
--puck-field-color-bordervar(--puck-color-border)Border color
--puck-field-color-border-hovervar(--puck-color-border-hover)Border color on hover / focus
--puck-field-color-border-focusvar(--puck-color-focus-ring)Focus ring color
--puck-field-color-border-draggingvar(--puck-color-selection-border)Border color while dragging
--puck-field-color-bg-disabledvar(--puck-color-surface-muted)Disabled control background
--puck-field-color-border-disabledvar(--puck-color-border)Disabled border color
--puck-field-color-text-disabledvar(--puck-color-text-secondary)Disabled text color
--puck-field-border-widthvar(--puck-border-width-regular)Border width
--puck-field-radiusvar(--puck-radius-m)Border radius
--puck-field-font-sizevar(--puck-font-size-xxs)Font size
--puck-field-space-xcalc(var(--puck-space-4) - var(--puck-border-width-regular))Horizontal padding
--puck-field-space-yvar(--puck-space-3)Vertical padding
--puck-field-space-surface-xcalc(var(--puck-space-4) - var(--puck-border-width-regular))Object / array horizontal padding
--puck-field-space-surface-yvar(--puck-space-4)Object / array vertical padding
--puck-field-label-color-textvar(--puck-color-text-secondary)Label text color
--puck-field-label-space-yvar(--puck-space-3)Label bottom spacing
--puck-field-label-font-sizevar(--puck-font-size-xxs)Label font size
--puck-field-label-font-weightvar(--puck-font-weight-semibold)Label font weight
--puck-field-label-color-iconvar(--puck-color-text-subtle)Label icon color

Array

TokenDefaultDescription
--puck-field-array-add-color-iconvar(--puck-color-interactive)Add button icon color

Rich Text

TokenDefaultDescription
--puck-field-richtext-menu-color-bgvar(--puck-color-surface-subtle)Toolbar background
--puck-field-richtext-menu-color-separatorvar(--puck-color-border-muted)Toolbar group separator
--puck-field-richtext-menu-space-x6pxToolbar horizontal padding
--puck-field-richtext-menu-space-y6pxToolbar vertical padding

External

TokenDefaultDescription
--puck-field-external-detach-color-bgvar(--puck-color-surface-subtle)Detach button background
--puck-field-external-detach-color-textvar(--puck-color-text-muted)Detach button text color