Skip to main content
UI Controls are interactive components that allow users to input data, make selections, and trigger actions within the WordPress block editor.

Buttons

Button

Lets users take actions and make choices with a single click or tap.
Variants:
  • primary - Bold color fill for primary actions (use sparingly, one per layout)
  • secondary - Standard actions that accompany primary actions
  • tertiary - Minimal emphasis for subtle actions
  • link - Low emphasis for supplementary or navigation actions
Props:
  • variant?: 'primary' | 'secondary' | 'tertiary' | 'link'
  • size?: 'default' | 'compact' | 'small'
  • icon?: IconType - Display an icon
  • iconPosition?: 'left' | 'right' - Icon placement
  • isDestructive?: boolean - For irreversible actions
  • isBusy?: boolean - Shows loading state
  • disabled?: boolean - Disables interaction
  • href?: string - Renders as anchor tag
  • label?: string - Accessibility label
  • showTooltip?: boolean - Display tooltip on hover
Storybook: Button
Status: Stable (global usage). Will be superseded by Button in @wordpress/ui, but continue using for now.

ButtonGroup

Groups related buttons together.

Text Inputs

TextControl

Lets users enter and edit single-line text.
Props:
  • label?: string - Field label
  • value: string - Current value
  • onChange: (value: string) => void - Change handler
  • type?: string - Input type (default: ‘text’)
  • help?: string - Help text below input
  • hideLabelFromVision?: boolean - Visually hide label
  • __next40pxDefaultSize?: boolean - Use 40px height

TextareaControl

Multi-line text input for longer content.

NumberControl

Numeric input with optional step controls.

Selection Controls

ToggleControl

Binary on/off switch for boolean values.

CheckboxControl

Single checkbox for boolean selection.

RadioControl

Mutually exclusive options selection.

SelectControl

Dropdown selection from a list of options.

ComboboxControl

Searchable dropdown with filtering.

RangeControl

Slider input for numeric values within a range.

Color Controls

ColorPicker

Full-featured color selection interface.

ColorPalette

Predefined color swatches for quick selection.

Date & Time

DateTimePicker

Combined date and time selection.

DatePicker

Date selection without time.

TimePicker

Time selection without date.

Validated Form Controls

For forms requiring validation, use the validated form control variants:

Advanced Controls

CustomSelectControl

Customizable select with rich content options.

UnitControl

Numeric input with unit selection (px, em, rem, etc.).

Resources