EmptyState fills the space a list or panel leaves when it holds nothing: a 48 px shape glyph, a title in head-card, one line that says what is missing and how it appears, and at most one action, inside a dashed die-line frame, an unprinted plate. Optional art (an <Art>) sits beside the words from the md container width, never behind them. Copy stays literal: "Nothing here yet.", never "All caught up!".
Example#
Nothing here yet.
Usage#
Use an empty state where a list or panel has nothing in it yet: no projects, no results, no messages. It says what is missing and how it appears, with at most one action.
- Parts. A 48 px shape glyph, a
title, one line ofdescriptionand an optionalaction, inside a dashed die-line frame, an unprinted plate. - Art may sit beside the words from the md width, never behind them.
- Copy is literal (D-I2): "Nothing here yet." The joke, if any, goes beside it.
Anatomy#
Nothing here yet.
- Glyph
data-mk-part="glyph" - Title
data-mk-part="title" - Description
data-mk-part="description" - Action
data-mk-part="action"
Volume#
Reading layer: identical at every volume; optional art follows the volume.
Quiet
Nothing here yet.
Studio
Nothing here yet.
Press
Nothing here yet.
Rave
Nothing here yet.
Content#
- Title: what is missing, plainly: "No projects yet".
- Description: how it fills up: "Projects appear here when you start one."
- Action: the verb that fills it: "Start a project".
Do and don't#
Do
No projects yet
Don't
All caught up!
Accessibility#
- The title is a real heading (
headingLevel, default 3); the glyph is decorative. - The one action is a normal
ButtonorLinkwith a literal verb.
The colour pairs it prints, with their contrast on both papers:
| Text | Surface | Role | Bone | Night |
|---|---|---|---|---|
--mk-ink-2 | --mk-paper | meta | 7.21:1 · Lc 80.3, passes | 12.18:1 · Lc 77.4, passes |
--mk-ink-2 | --mk-paper-sunken | meta | 6.65:1 · Lc 75.1, passes | 11.67:1 · Lc 77.0, passes |
--mk-ink-2 | --mk-paper-plate | meta | 8.06:1 · Lc 87.9, passes | 11.29:1 · Lc 76.6, passes |
Props#
| Prop | Type | Default | Description |
|---|---|---|---|
title required | ReactNode | none | |
description | ReactNode | none | One line: what is missing and what makes it appear. |
action | ReactElement<unknown, string | React.JSXElementConstructor<any>> | none | At most one action (a `Button` or a `Link`). |
glyph | GlyphName | square | The shape glyph (default `square`, an empty plate). |
art | ReactElement<unknown, string | React.JSXElementConstructor<any>> | none | An `<Art>` beside the words (below them on phones). |
headingLevel | 2 | 3 | 4 | 3 | The title's heading level (default 3). |
Tokens#
System tokens (10)
Changelog#
Arrived in 0.9.0.
Breadcrumbs,Pagination(withpaginationRange),Count,ProgressBar(bar, segments, indeterminate),AvatarandAvatarGroup,Tick,EmptyState,Kbd,SkeletonandLoader. Read the whole entryComboboxgives its inline list an id and the input's name in the server markup and marks its box as the input's focus-ring host, and a highlighted row's second line prints in--mk-text; theEmptyStateandPopoverdescriptions print in the meta role (16 px, 500, so--mk-text-2clears the APCA floor);SplashTitle's Quiet heading prints on its own paper plate and wraps inside its cell; theToastviewport and specimen keep one column no wider than their box;ProofSheet's frame links draw the focus ring. Read the whole entry