Empty
Present an empty or unavailable application state with optional media and actions.
Anatomy#
Usage#
Use Empty when a collection or search result is genuinely empty and the next action should be visible. It does not inspect data; the page decides when to render it. Use Skeleton while content is still loading.
Parts#
Compose only the parts you need. All parts belong inside Empty. Media accepts arbitrary JSX,
including Icon, Avatar, AvatarGroup, and images; it does not impose a fixed media size or background.
The root and its parts render a div by default, except Empty.Description, which renders a p.
Every part accepts as. Set a heading such as as="h2" on Empty.Title when the surrounding page
needs one. Empty adds no role or ARIA relationships automatically.
Sizes#
The sm, md (default), and lg sizes change padding, spacing, typography, and action gaps
together. Use sm within a Card or table, md for ordinary content, and lg for a page-level
empty state. Set size on Empty; the parts inherit it. Vertical padding is larger than horizontal
padding, and media and actions get extra space around them. Size does not resize the content placed
inside Media.
Examples#
Prompt a first project#
Show Empty when the collection is genuinely empty, not while it is still loading.
Start a conversation from an empty inbox#
Put the next useful command in Empty.Actions. Wire those buttons to application handlers.
Recover from an empty search#
Your search logic decides when to render this message. Offer a way to clear the query.
Invite the first team members#
Place avatars or an illustration in Media. The layout stays the same.
Frame a missing reports section#
Empty has no default border, background, shadow, or fixed height. Apply container styling with
class and style. A part’s own class and style take precedence over the root classes and
styles. Set as on the root to change its element, such as section with an aria-label.
API Reference#
Props#
Empty#
Props for Empty. Renders a <div> element by default.
Media#
Renders a <div> element by default.
Title#
Renders a <div> element by default.
Description#
Renders a <p> element by default.
Actions#
Renders a <div> element by default.