Skip to main content
Data display components are used to present information to users in various visual formats, from simple text and icons to complex data visualizations.

Loading States

Spinner

Notifies users that their action is being processed.
The Spinner displays an animated circular loading indicator. It automatically uses theme colors and is accessible with proper ARIA attributes. Usage:
  • Loading initial content
  • Processing actions
  • Waiting for API responses
Storybook: Spinner

ProgressBar

Shows determinate progress for long-running operations.
Props:
  • value?: number - Progress percentage (0-100)

Icons & Avatars

Icon

Displays SVG icons from the WordPress icon library or custom SVGs.
Props:
  • icon: IconType | SVGElement - Icon component or SVG
  • size?: number - Icon size in pixels
Storybook: Icon

Dashicon

Legacy icon component for WordPress Dashicons.
Deprecated: Use Icon with @wordpress/icons instead. Dashicon is maintained for backward compatibility.

Avatar

Displays user profile images or initials.
Props:
  • name?: string - User name (shows initials if no image)
  • src?: string - Avatar image URL
  • size?: number - Avatar size in pixels

AvatarGroup

Displays multiple avatars in a group.
Props:
  • avatars: Array<AvatarProps> - Array of avatar objects
  • maxAvatars?: number - Maximum visible avatars (shows +N for overflow)

Status Indicators

Badge

Small label for status, counts, or categories.
Props:
  • intent?: 'default' | 'info' | 'success' | 'warning' | 'error' - Badge color scheme
  • children: ReactNode - Badge content

Indicator

Simple colored dot for status indication.

Text Display

Text

Typography component for consistent text styling.
Props:
  • size?: 'body' | 'caption' | 'footnote' | 'largeTitle' | 'title' - Text size
  • weight?: number - Font weight (100-900)
  • variant?: 'default' | 'muted' - Text style variant
  • isBlock?: boolean - Display as block element
  • truncate?: boolean - Truncate with ellipsis

Heading

Semantic heading component with consistent styling.
Props:
  • level: 1 | 2 | 3 | 4 | 5 | 6 - Heading level (required)
  • weight?: number - Font weight
  • color?: string - Text color

Truncate

Truncates text with ellipsis.
Props:
  • numberOfLines?: number - Maximum number of lines (default: 1)
  • limit?: number - Maximum character count
  • ellipsizeMode?: 'auto' | 'head' | 'tail' | 'middle' - Ellipsis position

Color Display

ColorIndicator

Displays a color swatch.
Props:
  • colorValue: string - Color value (hex, rgb, named)

GradientPicker

Displays gradient previews and allows gradient selection.

Media Display

Link that opens in a new tab with proper accessibility.
Automatically adds:
  • target="_blank"
  • rel="noopener noreferrer"
  • External link icon
  • Screen reader text
Storybook: ExternalLink

FocalPointPicker

Interactive control for selecting image focal point.
Props:
  • url: string - Image URL
  • value: { x: number, y: number } - Focal point (0-1 range)
  • onChange: (value) => void - Change handler

Placeholder

Placeholder component for empty states.
Props:
  • icon?: IconType - Placeholder icon
  • label?: string - Main label
  • instructions?: string - Instructional text
  • children?: ReactNode - Actions or additional content
Storybook: Placeholder

Sandbox

Safely renders HTML content in an iframe.
Props:
  • html: string - HTML content to render
  • title?: string - Iframe title
  • styles?: string - Additional CSS styles
The Sandbox component isolates potentially unsafe HTML in an iframe, preventing it from affecting the parent page.

Data Visualization

For complex data visualization and tables, consider using:
  • DataViews from @wordpress/dataviews - Table and grid views with sorting, filtering, and actions
  • FormTokenField - Token/tag input for displaying multiple items

Accessibility

All data display components include proper ARIA labels and roles:
  • Spinner includes role="presentation" and focusable="false"
  • Avatar includes fallback to initials with proper contrast
  • ColorIndicator uses accessible color contrast checking
  • ExternalLink announces external destination to screen readers

Resources