Skip to main content
The @wordpress/components package provides a library of generic, reusable UI components for building WordPress interfaces. These components follow WordPress design patterns and are used throughout the block editor.

Installation

Basic Usage

Loading Styles

Components require CSS to display correctly: In WordPress:
In other projects:

Common Components

Button

Clickable button component.
Variants:
  • primary - Primary action button
  • secondary - Secondary action button
  • tertiary - Tertiary/text button
  • link - Link-style button

Panel

Collapsible panel container.

TextControl

Text input field.

TextareaControl

Multi-line text input.

SelectControl

Dropdown select field.

CheckboxControl

Checkbox input.

ToggleControl

Toggle switch.

RadioControl

Radio button group.

RangeControl

Numeric range slider.

Layout Components

Card

Card container with header and content.
Dialog modal overlay.

Popover

Floating popover element.
Dropdown menu.

TabPanel

Tabbed interface.
Keyboard-navigable menu.

Advanced Components

ColorPicker

Color selection interface.

DateTimePicker

Date and time selection.

TreeSelect

Hierarchical select dropdown.

Notification Components

Notice

Inline notification message.
Status options:
  • success
  • error
  • warning
  • info

Snackbar

Temporary notification toast.

Utility Components

Spinner

Loading indicator.

Placeholder

Empty state placeholder.

Icon

Icon display component.

Using Popovers

When using Popover components, include the Popover.Slot:

TypeScript

Extract props types using React’s ComponentProps:

Learn More