@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:Common Components
Button
Clickable button component.primary- Primary action buttonsecondary- Secondary action buttontertiary- Tertiary/text buttonlink- 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.Modal
Dialog modal overlay.Popover
Floating popover element.Dropdown
Dropdown menu.Navigation Components
TabPanel
Tabbed interface.NavigableMenu
Keyboard-navigable menu.Advanced Components
ColorPicker
Color selection interface.DateTimePicker
Date and time selection.TreeSelect
Hierarchical select dropdown.Notification Components
Notice
Inline notification message.successerrorwarninginfo