EmptyState

Empty states explain why content is unavailable and, when useful, give people a clear next step.

Overview and decision boundary

Use EmptyState when a surface has no content and the user needs context or a next step.

Do not blame users, show technical failures without context, or reuse the same generic copy for every product state.

No team members yet

Invite people to collaborate on projects and share updates with the team.

import { UserPlus } from "@nerio-ui/adapters/icons";import {  EmptyState,  EmptyStateActions,  EmptyStateDescription,  EmptyStateHeader,  EmptyStateMedia,  EmptyStateTitle,  Icon,} from "@nerio-ui/ui";import { Button } from "@nerio-ui/ui/client";<EmptyState size="lg">  <EmptyStateMedia aria-hidden="true">    <Icon icon={UserPlus} />  </EmptyStateMedia>  <EmptyStateHeader>    <EmptyStateTitle>No team members yet</EmptyStateTitle>    <EmptyStateDescription>      Invite people to collaborate on projects and share updates with the team.    </EmptyStateDescription>  </EmptyStateHeader>  <EmptyStateActions>    <Button leadingIcon={UserPlus} size="md">Invite team members</Button>  </EmptyStateActions></EmptyState>

Installation and imports

Install the editable registry source, or use the matching package entrypoint when the product keeps Nerio as a workspace dependency.

pnpm exec nerio add empty-stateimport { EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateHeader, EmptyStateTitle } from '@nerio-ui/ui';import { Button } from '@nerio-ui/ui/client';

Usage

import { EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateHeader, EmptyStateTitle } from '@nerio-ui/ui';import { Button } from '@nerio-ui/ui/client';<EmptyState>  <EmptyStateHeader>    <EmptyStateTitle>No collections</EmptyStateTitle>    <EmptyStateDescription>Create one to start organizing work.</EmptyStateDescription>  </EmptyStateHeader>  <EmptyStateActions>    <Button>Create collection</Button>    <Button variant="ghost">Learn more</Button>  </EmptyStateActions></EmptyState>

Variants

APIValueUse
sizesmCompact tables, lists, cards, sidebars, and panels.
sizemdStandard page sections and large containers. This is the default.
sizelgPage-level empty states and first-use onboarding.
aligncenterCenters the content within the available parent surface. This is the default.
alignstartAligns content to the start edge for dialogs, sidebars, and narrow panels.
media varianticonAdds a compact neutral icon container sized by the parent EmptyState.
media variantillustrationAccepts consumer-owned SVG, image, or custom illustration without a background.
actions orientationhorizontal | verticalWraps actions by default, or stacks them when a vertical action group is clearer.

Anatomy

SlotPurpose
empty-stateOptional root container that owns size, alignment, and standard HTML/ARIA attributes.
empty-state-mediaOptional icon or illustration container.
empty-state-headerOptional grouping for the title and description with a readable max width.
empty-state-titleOptional semantic heading. It renders h3 by default and supports h2 through h6.
empty-state-descriptionOptional muted supporting copy rendered as a paragraph.
empty-state-actionsOptional wrapping group for buttons, links, or other consumer-supplied controls.

States

SituationAnnouncement and behavior
Static empty contentUse no ARIA role by default; the surrounding page context already explains the state.
Asynchronous searchPass role=status or aria-live=polite when a changed query produces no results.
Recoverable errorPass role=alert only when a failure needs immediate announcement, then provide retry when useful.
Permission limitedUse neutral media and clear copy; a request-access action belongs in EmptyStateActions.

Motion

  • State changes should use shared motion tokens and preserve reduced-motion behavior.

Accessibility

  • EmptyState has no live region or alert role by default; add role=status for asynchronous results and role=alert for an error that needs immediate announcement.
  • Keep a clear title, description, and any actions in reading order; decorative media should be aria-hidden.
  • Provide no more than two actions unless the surrounding product flow provides a stronger pattern.

Review the shared responsibility and evidence boundaries in the Accessibility foundation alongside this component-specific contract. Use the Spacing & layout foundation for shared density, wrapping, overflow, reflow, and component-versus-product ownership guidance. The Color foundation, Typography foundation, and Localization foundation define the shared visual-role, text-resilience, direction, and locale boundaries used by component examples.

API

PropValuesPurpose
EmptyState.sizesm | md | lgControls internal spacing, icon media size, and heading scale.
EmptyState.aligncenter | startControls content alignment without forcing parent dimensions or chrome.
EmptyStateMedia.varianticon | illustrationChooses compact icon treatment or unframed illustration content.
EmptyStateTitle.ash2 | h3 | h4 | h5 | h6Selects the heading level that fits the page hierarchy.
EmptyStateActions.orientationhorizontal | verticalControls the action group direction; horizontal actions still wrap.
All slotsclassName + native propsForward refs and standard HTML, data, and ARIA attributes.

Implementation contract

ContractValue
Registry itemempty-state installs its component, cn utility, and feedback styles.
Base UINo interactive primitive is required.
Registry dependenciesNone.
Package dependenciesclsx, react

Styling contract

ContractValue
AuthoringComplete, statically detectable Tailwind CSS v4 recipes own component visuals.
ValuesSemantic and component --n-* variables remain the canonical customization layer.
OverridesCustomizable slots merge consumer className values with tailwindCn so conflicting utilities resolve deterministically.
Residual CSSOnly shared keyframes and scoped no-Preflight compatibility rules remain; there is no parallel visual selector layer.

Design notes

  • Use EmptyState when a surface has no content and the user needs context or a next step.

Do / do not

Do
Use a short title, explain the most useful next step, and keep the action set to one primary action plus at most one secondary action.
Do not
Reuse generic copy for every state, blame the user, or turn the whole empty-state surface into an interactive control.

Tokens

GroupTokensControls
Media--n-empty-state-mark-size / background / foregroundIcon media dimensions and neutral emphasis.
Spacing--n-empty-state-gapVertical separation between composed slots.