EmptyState
Display a placeholder for no data, empty results and first-run states
Source
Package
Usage
EmptyState displays a placeholder when there is nothing to show: empty search results,
empty tables, first-run states. Set icon, title and description props:
We couldn't find anything matching your search. Try adjusting your filters or searching with different keywords to see more results.
Compound components
For full control over the content, use compound components instead of the shorthand props:
We couldn't find anything matching your search. Try adjusting your filters or searching with different keywords to see more results.
Both can be combined, children are rendered after the content from the props.
EmptyState.Indicator is always rendered first, and the icon prop replaces it when both are set:
Variant
Set variant to filled or light to display the icon inside a colored circle,
use color to change its color:
We couldn't find anything matching your search. Try adjusting your filters or searching with different keywords to see more results.
Indicator background
Set withIndicatorBackground to display a neutral circle behind the icon without a variant:
Your shopping cart is empty right now. Browse our catalog and add the items you like to get started with your first order.
Styles API
EmptyState supports the Styles API; you can add styles to any inner element of the component with the classNames prop. Follow the Styles API documentation to learn more.
We couldn't find anything matching your search. Try adjusting your filters or searching with different keywords to see more results.
Component Styles API
Hover or focus a selector to highlight its elements
Accessibility
The title prop renders a div by default.
If the empty state needs a heading, set order on EmptyState.Title to match the surrounding heading levels:
The indicator is decorative and hidden from screen readers. Put its meaning in the title or description:
To announce an empty search result, keep the role="status" container mounted and update its contents:
Give each action button a descriptive label. For an icon-only button, use aria-label: