Mushilu-San UI

Search components

PlaygroundStorybookGitHub
Data display

Empty state

A placeholder for a list or area with no content yet, with a title, text and an action.

Selector: mui-empty

Import
import { Empty } from '@mushilu-san/ui/data-display';
PreviewCode

Loading example…

Overview

Empty state explains why an area has no content and what to do next. Set title and description, add an icon with slot="icon", and an action button with slot="action".

The host is role="status", so the message is announced when it appears.

When to use

  • A list, table or search that has no results yet.
  • A first-run screen before the user adds anything.

When not to use

  • An error. Use an alert with the reason and a way to retry. Use Alert instead.

Guidelines

Do

  • Say what the area is for and how to fill it.
  • Offer one clear next action.

Don't

  • Do not show an empty state while the content is still loading. Use a skeleton.
  • Do not blame the user in the text.

Accessibility

Roles and attributes

ElementRoleNotes
hoststatusAnnounced when it appears.
icon—Decorative (aria-hidden).

Keyboard

KeysAction
TabShiftTabMoves focus to the action button.
  • Keep the title meaningful on its own, since it is the first thing a screen reader user hears.

API

Empty

Selector: mui-empty

NameTypeDefaultDescription
titlestring | undefined— Short heading that says what is missing.
descriptionstring | undefined— Explanation of why the area is empty and what to do next.

CSS parts

  • ::part(action)
  • ::part(description)
  • ::part(icon)
  • ::part(root)
  • ::part(title)

Tokens

  • --mui-color-text
  • --mui-color-text-muted
  • --mui-space-6