Skip to content
menumenu tanreiexpand_morecontrasttranslate
tanreiexpand_more
Getting startedWebReactSwiftUIJetpack ComposeFlutterReact NativePresetsYour own design systemUsing Tanrei with AI agentsBrandDesign tokensDesign systems and customizationTheme StudioColorTypographyIconsShapeElevationMotionInteraction statesBehaviourLayoutAccessibilityWordsColor tokensTypescale tokensShape tokensElevation tokensMotion tokensState tokensSpace and measure tokensComponentsButtonMain action buttonSegmented buttonButton groupButton with menuToolbarCopy buttonCheckboxRadio buttonSwitchChipMenuSliderSlider fieldCalendarDateTimePickerField groupRadio groupCheckbox groupSelectSelect fieldMenubarFile uploadFile picker AdvancedDrop zoneText input AdvancedText fieldChip fieldFieldCombobox AdvancedCombobox fieldNumber input AdvancedNumber fieldColor input AdvancedColor fieldOne-time-code input AdvancedOne-time-code fieldEmbedded text input AdvancedChat composerCardDividerModal layer AdvancedDialogListList rowBottom sheetSide sheetCarouselCode blockTablePopoverStepsAccordionDescription listFigureApp shellPage headerTree viewTimelineImage previewHandleResizable frameScroll areaBadgeProgress indicatorMeterNumber tickerLoading indicatorSnackbarTooltipKeyboard shortcutTagInline codeCalloutAvatarEmpty stateTag groupSkeletonFile itemSwatchMarquee textTabsTab viewApp barNavigation barNavigation drawerSearchLinkPaginationPrevious and next linksStepperBreadcrumbsTable of contentsLink cardFAB menuStatusHow Tanrei is builtContributingLicense and attribution
HomeComponentsEmpty state

Empty state

What stands in the place of content that is not there — a search with no results, a list nobody has added to, a page before its first item — and says what is missing, why or what to do, and offers the action that does it.

content_copyView as Markdown
Category
Communication
Tokens
comp.empty-state
Level
Base

Overview

Web
tanrei-empty-state
schedule
SwiftUI
TanreiEmptyState
radio_button_unchecked
Jetpack Compose
TanreiEmptyState
radio_button_unchecked
Flutter
TanreiEmptyState
radio_button_unchecked
React Native
EmptyState
radio_button_unchecked

Generated from docs/status/status.json, specs/empty-state.spec.json

A list nobody has added to yet, and a search that found nothing

folder_openA project keeps the layers, the exports and the people of one design system together.New projectImport a layersearch_offCheck the spelling, or search for a shorter word.Clear the search

An empty state stands where content would be and there is none: it replaces the list, the rows, the results. It says what is missing in a few words, why or what to do in a sentence, and offers the control that does it. It is quiet and flat — no fill, no edge — and it is content, read where it stands: it takes no focus and has no state.

On the web it is <tanrei-empty-state>. The other platforms have not implemented it yet.

Usage

The description is the element’s own content. The title is the headline attribute, exposed as a heading of the level level gives, or the title slot where it is a heading or other content of your own. A glyph of the icon set, or a picture of your own, goes in the media slot, and your own Buttons or links in the actions slot. Every word is yours: the component has none of its own.

<!-- A region inside a view: a glyph, a title, a sentence, the action. -->
<tanrei-empty-state headline="No projects yet">
  <span slot="media">folder_open</span>
  A project keeps the layers, the exports and the people of one design system together.
  <tanrei-button slot="actions">New project</tanrei-button>
  <tanrei-button slot="actions" variant="text">Import a layer</tanrei-button>
</tanrei-empty-state>

<!-- A page that is empty as a whole: large, and its title is the page's heading. -->
<tanrei-empty-state size="large">
  <h1 slot="title">This page does not exist</h1>
  The address may be mistyped, or the page may have moved.
  <a slot="actions" class="tanrei-link" href="/">Go to the start page</a>
</tanrei-empty-state>

<!-- In a side panel: at the start edge, where the list would have begun. -->
<tanrei-empty-state align="start" headline="Nothing differs from the base yet">
  Change a value on the left and it is listed here.
</tanrei-empty-state>

<!-- In answer to a filter: announced once, politely, when it is shown. -->
<tanrei-empty-state id="no-rows" live hidden headline="No entries match these filters">
  Three filters are on. Removing one shows more entries.
  <tanrei-button slot="actions" variant="outlined">Clear the filters</tanrei-button>
</tanrei-empty-state>

<script type="module">
  import '@tanrei/web/components/empty-state';
  import '@tanrei/web/empty-state.css'; // the place a server-rendered empty state keeps before the element is defined
</script>
import { Button, EmptyState } from '@tanrei/react';

{rows.length === 0 && (
  <EmptyState live headline="No entries match these filters">
    Three filters are on. Removing one shows more entries.
    <Button slot="actions" variant="outlined" onClick={clearFilters}>Clear the filters</Button>
  </EmptyState>
)}

Specs

The parts, added one by one

A project keeps the layers, the exports and the people of one design system together.folder_openA project keeps the layers, the exports and the people of one design system together.folder_openA project keeps the layers, the exports and the people of one design system together.New projectImport a layer

At the start edge, and the large size

Change a value on the left and it is listed here.explore_offThe address may be mistyped, or the page may have moved.Go to the start page

Anatomy

Anatomy

Drawn over the fixture title, as the web package draws it.
Part Description
1 container The block that holds the message, as wide as the region it stands in and as tall as its content and its padding, with no fill, no edge and no elevation: it is drawn on the surface of the region whose content is missing. It carries no state.
2 media · optional What pictures the empty place, above the title: a glyph of the system's icon set, in a quiet color, or a picture of the product's own. Decorative: the title says it.
3 title What is missing, in a few words ("No results", "No projects yet"). The one part at the surface's full text color. Plain text unless the product gives a heading; it wraps and is never cut.
4 description · optional Why the place is empty, or what the person can do about it, in a sentence or two, in a quiet color. The product's content: text, with links where it needs them.
5 actions · optional One or two of the product's own Buttons or links that fill the place or change what was asked for ("New project", "Clear the filter"), in a row below the text.

Measurements

Measurements

Length Token Value (px)
container padding-inline tanrei.comp.empty-state.container.padding-inline 16
Drawn over the fixture title, as the web package draws it.

Properties

Property Type Default Description
title string "" What is missing, in a few words, in the product's language ("No results for tokne"). Exposed as a heading of the level `level` gives, since it is drawn as one. The title slot takes its place where the product needs inline content or a heading element of its own.
level number 2 The level of the heading the title prop is exposed as, 1 to 6, so that the empty state takes its place in the outline of the page around it: 2, the default, for the main region of a view under the page's own title; deeper inside a section, a card or a panel that has a heading of its own. Ignored where the title slot holds the product's own content, whose role and level are the product's.
size medium | large "medium" Medium is for an empty region inside a view: a list, a table's body, a card, a panel, a search's results. Large is for a view that is empty as a whole: the main region of a page before its first item, a page that was not found. It changes the room above and below, the glyph's size and the text styles. A design system may add values.
align center | start "center" Where the parts stand on the inline axis. Center, the default, is for a region that is otherwise blank. Start puts every part at the region's start edge with its text aligned there, for a narrow column, a list in a side panel or a table whose header stays in view, where the content would have begun at that edge.
live boolean false Whether the empty state is announced. False, the default, is for a place that is empty when its view is presented: it is read where it stands. True is for one that appears in answer to what the person did (a search that found nothing, a filter that matches no row, the last item removed): it is a live region, announced once, politely, when it is shown and when its text changes. It is never announced assertively and never takes focus: an empty place is not an error. It changes nothing that is drawn.

Slots

Slot Description
default The description: text, with the product's own links and inline content. Empty draws the title alone.
media A glyph of the system's icon set, by name, drawn through the platform's icon helper at the media size; or a picture of the product's own (an illustration), which keeps its own size and colors.
title The product's own title content in place of the title prop: a heading of the level the page's outline needs, or text with inline content. The empty state draws it in the title's style and changes neither its role nor its level.
actions The actions: the product's own Buttons or links, one or two, the main one first. The empty state lays them out below the text and does nothing else to them.

States

Behavior

Requirements in EARS form. Every platform implementation is tested against these ids.

ID Requirement
EMP-1 THE empty state SHALL lay itself out as a block that takes the whole inline size of the region it is placed in and is as tall as its content and its padding: it SHALL lay out in one column, in this order, its media, its title, its description and its actions, those it has, padded above the first and below the last by the block padding of its size (comp.empty-state.container.padding-block.medium for medium, comp.empty-state.container.padding-block.large for large) and at the start and the end by comp.empty-state.container.padding-inline. THE empty state SHALL draw no fill, no edge and no elevation, SHALL bring no outer space of its own, SHALL set no height of its own and SHALL NOT scroll: where the region is taller, placing the block in it is the region's.
EMP-2 WHILE align is center THE empty state SHALL centre every part on the inline axis of its container and centre the lines of its title and its description; WHILE align is start THE empty state SHALL place every part at the container's start edge, inside the inline padding, and align the lines of its text to the start. In both THE empty state SHALL keep its title and its description no wider than comp.empty-state.content.measure times the description's font size, and no wider than the container less its inline padding.
EMP-3 WHERE the media slot holds a glyph THE empty state SHALL draw it first, in a box of the media size of its size (comp.empty-state.media.size.medium for medium, comp.empty-state.media.size.large for large), in comp.empty-state.media.color, with sys.icon.family.unselected and sys.icon.fill.unselected, sys.icon.weight and an optical size clamped between sys.icon.optical-size.min and sys.icon.optical-size.max, and SHALL begin the title comp.empty-state.media.gap below it. WHERE the slot holds a picture or a view of the product's own THE empty state SHALL draw it in the same place at its own size, never wider than the container less its inline padding and with its proportions kept, and SHALL NOT color, clip or mirror it. THE empty state SHALL keep the media from assistive technology, and SHALL draw no media the product did not give.
EMP-4 THE empty state SHALL draw its title in the text style of its size (comp.empty-state.title.typescale.medium for medium, comp.empty-state.title.typescale.large for large) and in comp.empty-state.title.color; the title SHALL wrap and SHALL never be cut. THE empty state SHALL expose a title given as text as a heading — of the level the level prop gives on a platform whose headings have levels, and with the platform's heading trait on one whose headings have none — because it is drawn larger and heavier than what follows it, and a text drawn as a heading and not exposed as one tells by its look alone what its structure is. IF level is not a whole number from 1 to 6 THE empty state SHALL use 2 and report it in debug builds. WHERE the title slot holds content THE empty state SHALL draw that content in the title's place, style and color instead of the title prop, and SHALL change neither its role nor its level: a title the product gives as a heading stays a heading of the level the product gave it, and inline content the product gives stays what it is. THE empty state SHALL set the title's letter-spacing by the script of its text, as every title is set (PRS-20): no negative letter-spacing WHERE its language is Chinese, Japanese or Korean, and none WHERE its script joins its letters or stacks marks on them.
EMP-5 WHERE the default slot holds content THE empty state SHALL draw it as the description, comp.empty-state.title.gap below the title, in the text style of its size (comp.empty-state.description.typescale.medium for medium, comp.empty-state.description.typescale.large for large) and in comp.empty-state.description.color; the description SHALL wrap and SHALL never be cut or limited to a number of lines. A link in the description is the product's own and is drawn by its own spec, in its own color and underlined.
EMP-6 WHERE the actions slot holds content THE empty state SHALL lay it out in one row comp.empty-state.actions.gap below the text, in the order given from the start, comp.empty-state.actions.item-gap apart, centred or at the start as align says (EMP-2); WHERE the row does not fit the container THE empty state SHALL wrap it, comp.empty-state.actions.item-gap between its lines, and SHALL never cut or shrink an action below its own minimum. THE empty state SHALL NOT restyle, resize, reorder or rename the actions, and SHALL emit no event of its own: an action's press is that control's.
EMP-7 THE empty state SHALL NOT take pointer, touch or keyboard input, SHALL NOT take focus or be a stop in the focus order, and SHALL NOT change anything it draws under a pointer, a press or focus: it has no hovered, focused, pressed, selected or disabled state and draws no state layer and no focus indicator. What the product places in it — a link in the description, a Button in the actions — takes input and focus by its own spec, in the order the parts are drawn, and text in the title and the description SHALL remain selectable where the platform lets text be selected.
EMP-8 WHILE live is false THE empty state SHALL be exposed to assistive technology as plain content, read where it stands in reading order: its title as a heading (of the level level gives, or the product's own content in the title slot as the product gave it), then its description, then its actions as the controls they are. It SHALL have no role and no name of its own, SHALL NOT be announced when it is shown or when its text changes, SHALL NOT move focus, and SHALL NOT be exposed as an alert, a status, a dialog or a note: an empty place is content, not a message.
EMP-9 WHILE live is true THE empty state SHALL be a polite live region. WHEN it is shown after its page or view was first presented, and WHEN its title or its description changes while it is shown, THE empty state SHALL have assistive technology announce it once, after what is being read: the title, then the description, and not the names of its actions. It SHALL never announce assertively and SHALL NOT move keyboard or screen-reader focus. A live empty state that is drawn with the first presentation of its page or view SHALL NOT announce itself then. live SHALL change nothing that is drawn.
EMP-10 WHEN title, the title slot's content, the description, the media or the actions change THE empty state SHALL draw and expose the new value at once, without a motion, and SHALL announce it only as EMP-9 says. THE empty state SHALL neither show nor hide itself: whether the place is empty is the product's to know, and the product puts the empty state there and takes it away.
EMP-11 WHILE the text size is enlarged THE empty state SHALL grow its title and its description, and the measure with them, keep its paddings and gaps, wrap, and grow in height; it SHALL keep a glyph's box at the media size of its size, SHALL cut nothing and set no fixed height, SHALL lose no content when the reader raises line height, paragraph spacing, letter spacing or word spacing, and SHALL need no horizontal scrolling at a width of 320 points with text at 200 %, its actions then each on a line of their own where two do not fit side by side.
EMP-12 WHERE the platform draws with a person's own forced colors (the web's forced-colors mode, and a platform's equivalent where it has one) THE empty state SHALL draw its glyph, its title and its description in the platform's text color, and leave links, Buttons and a picture of the product's own to their own specs and colors; nothing the empty state draws relies on a fill.
EMP-13 WHERE the layout direction is right-to-left THE empty state SHALL apply its paddings by logical start and end and mirror the order of its actions, so that the first action is at the right; WHILE align is start it SHALL place every part at the right edge and align its text to the right; WHILE align is center the column stays centred.
EMP-14 THE empty state SHALL take its layout direction from where it is used — the direction of the nearest ancestor that sets one, and the platform's own where none does — and SHALL have no direction setting of its own; WHEN that direction changes while the empty state is shown THE empty state SHALL draw itself for the new direction at once, without a motion of its own, keeping what it shows.
EMP-15 WHERE the layout direction is right-to-left THE empty state SHALL draw the glyph of its media slot mirrored left to right exactly when the system's icon set marks that glyph's name as mirrored or the product forces mirroring for that use, and unmirrored when the product forbids it: the icon helper mirrors the glyph inside its own box, about the box's vertical centre line, changing neither its place, size, color and fill nor the order EMP-13 gives. THE empty state SHALL NOT mirror a glyph itself, and SHALL NOT mirror content the product gives as a picture or a view of its own rather than by a glyph's name.
EMP-16 THE empty state SHALL lay out a title given as text as text of its own direction, isolated from the text around it: it takes the base direction of its first strong character, or the layout direction where it has none, so that a title that quotes what the person typed, a file's name or a number keeps its own order in a right-to-left layout; THE empty state SHALL still place the title and align its lines by the layout direction and by align, not by the text's own. The description's direction is its content's.
EMP-17 WHEN size names a value that the active design system does not have, or align names a value this spec does not have, THE empty state SHALL render with the default value, and in debug builds report the unknown value.
EMP-18 IF the title, the title slot and the description are all empty THE empty state SHALL draw nothing, take no space and expose nothing, and in debug builds report that an empty state says nothing: a glyph or actions alone do not tell a person what is missing. IF the description is given and the title and the title slot are empty THE empty state SHALL still render and in debug builds report that an empty state has no title.

Platform name mapping

Parity does not mean identical APIs. Each platform uses its own idiom for the same contract.

Spec Web SwiftUI Jetpack Compose Flutter React Native
Component tanrei-empty-state TanreiEmptyState TanreiEmptyState TanreiEmptyState EmptyState
title · Property headline title title title title
level · Property level headingLevel headingLevel headingLevel headingLevel
size · Property size size size size size
align · Property align alignment alignment alignment align
live · Property live isLive live live live
Notes It is the form the callout takes. <tanrei-empty-state> with the description as light-DOM children, the glyph or the picture in the media slot, the title in the title slot (<p slot="title">, or <h2 slot="title"> where it is a heading) or the headline attribute (HTML's global title attribute would show a tooltip over the whole block, as on the callout), which the shadow root draws as an element with role="heading" and aria-level from level (a number property and attribute, 2 by default), and Buttons or links in the actions slot. Everything the product writes stays in the document: the title where it is slotted, the description, the links and the Buttons are light-DOM content, read by a crawler and by a page without script. **Before the element is defined** the stylesheet of @tanrei/web gives tanrei-empty-state:not(:defined) display: block, the block and inline padding of its size, the description's text style and color, and text-align by its align, so the content is readable in its place and the block keeps most of its height; a headline attribute does not show until the element is defined, which is why a page that must read without script gives the title in the slot. The host has no role, no tabindex and no listeners; the glyph is aria-hidden. With live the announcement is made through a visually hidden role="status" region in the shadow root that exists from the element's first render and is filled, with the title and the description's text, only when the element is connected or changed after the document's first presentation (EMP-9); the host itself gets no live role, so slotted content is not read twice. The text block's width is max-inline-size: calc(var(--tanrei-comp-empty-state-content-measure) * 1em) on the element that carries the description's font size (EMP-2). The description takes its color and text style through inherited color and font, so text placed directly in the element is styled. In a table the element goes in one <td colspan> of a body row, or directly after the table, which keeps its caption and its header row (the Table spec says nothing of an empty body); in a list it takes the list's place rather than being an item. Nothing changes under forced-colors: active but the colors the mode sets (EMP-12). TanreiEmptyState(_ title: String, size:, alignment:, isLive:, media:, actions:) { description }, the glyph given by name through icon: or a view through media:; a heading title is the title: view builder with the header trait set by the product. Not the platform's own unavailable-content view, whose sizes and colors are the platform's: the same structure drawn from Tanrei's tokens. isLive posts one announcement with the title and the description when the view appears after its screen did. Not built on this platform yet: EMP-4's title given as text exposed as a heading, and level. TanreiEmptyState(title, size, alignment, live, media, actions) { description }, the glyph given by name through icon or a composable through media. With live the text column has liveRegion = LiveRegionMode.Polite, set only after the first composition of its screen. Not built on this platform yet: EMP-4's title given as text exposed as a heading, and level. TanreiEmptyState(title: …, size:, alignment:, live:, icon:, media:, actions: […], child: description); titleWidget: takes a heading of the product's own. With live the text is wrapped in Semantics(liveRegion: true) after the first frame of its route, and announced through SemanticsService.announce with polite assertiveness where the platform does not read live regions. Not built on this platform yet: EMP-4's title given as text exposed as a heading, and level. <EmptyState title="No projects yet" icon="folder_open" actions={…}>description</EmptyState>; media takes an element of the product's own. With live, accessibilityLiveRegion="polite" on Android and one AccessibilityInfo.announceForAccessibility call on iOS when it mounts after its screen. Follows the app's direction where an ancestor's is not known. Not built on this platform yet: EMP-4's title given as text exposed as a heading, and level.

Tokens

Token Aliases Resolved (light)
--tanrei-comp-empty-state-actions-gap sys.space.space200 16px
--tanrei-comp-empty-state-actions-item-gap sys.space.space100 8px
--tanrei-comp-empty-state-container-padding-block-large sys.space.space800 64px
--tanrei-comp-empty-state-container-padding-block-medium sys.space.space400 32px
--tanrei-comp-empty-state-container-padding-inline sys.space.space200 16px
--tanrei-comp-empty-state-content-measure — 30
--tanrei-comp-empty-state-description-color sys.color.on-surface-variant #4b4b4b
--tanrei-comp-empty-state-media-color sys.color.on-surface-variant #4b4b4b
--tanrei-comp-empty-state-media-gap sys.space.space200 16px
--tanrei-comp-empty-state-media-size-large — 48px
--tanrei-comp-empty-state-media-size-medium sys.icon.large 32px
--tanrei-comp-empty-state-title-color sys.color.on-surface #1b1b1b
--tanrei-comp-empty-state-title-gap sys.space.space50 4px
--tanrei-comp-empty-state-description-typescale-large sys.typescale.body-large 400 16px/1.625
--tanrei-comp-empty-state-description-typescale-medium sys.typescale.body 400 14px/1.5714
--tanrei-comp-empty-state-title-typescale-large sys.typescale.heading-3 500 20px/1.4
--tanrei-comp-empty-state-title-typescale-medium sys.typescale.heading-5 500 16px/1.5

Fixtures

Canonical renderings. Every platform snapshots each fixture under the same id so the results can be compared.

Generated from specs/empty-state.spec.json, tokens/comp/empty-state.tokens.json, design/tokens/

Guidelines

Empty state, callout, snackbar, status text

Component What it is Where it stands
Empty state The place of content that is not there. Where the list, the rows or the results would be.
Callout A notice about content that is there. Beside that content, in the flow.
Snackbar The result of something that just happened. Above the content, briefly.
A search’s status text The count of what was found (“No results for tokne”). In the search’s own status row.

An empty place is not an error. Content that failed to load is a callout with the error status in the same place, and content that is still loading is a loading indicator. The three states of a region — loading, empty, failed — are the region’s to switch between; the empty state neither shows nor hides itself.

Sizes

size Above and below Glyph Title Description Use for
medium (default) 32 32 16 14 A region inside a view: a list, a table’s body, a card, a panel, a search’s results.
large 64 48 20 16 A view that is empty as a whole: a page before its first item, a page that was not found.

The block is as wide as its region and as tall as its content and padding. Where the region is taller, placing the block in it — centring it, keeping a table’s minimum height — is the region’s. The text is kept to about 60 Latin characters a line (30 times the description’s size), so a sentence in the middle of a wide table does not run from edge to edge.

Alignment

align is center (the default) for a region that is otherwise blank, and start for a narrow column, a list in a side panel, or a table whose header stays in view: the message then begins where the content would have.

Title

headline is exposed as a heading, because it is drawn as one: of level 2 by default, for the main region of a view under the page’s own title. Set level to the level your page’s outline needs: deeper inside a section, a card or a panel that has a heading of its own. A title in the title slot is drawn as any title, and the empty state changes neither its role nor its level: give your own heading element there, or text where the title must not be a heading.

On a page that is rendered on a server, give the title in the title slot: a headline attribute is drawn by the element, so it is not shown before the element is defined.

Media

A glyph is given by its name, in an element: <span slot="media">folder_open</span>. It is drawn at the media size, in a quiet color. Anything else in the slot — an <img>, an <svg>, an element of your own — is a picture: it keeps its own size and colors, is never wider than the block, and is never mirrored. The media is decorative and hidden from assistive technology, so do not put the only way forward in the picture. Tanrei ships no illustrations.

Actions

The actions are your own Buttons or links, one or two, the main one first. The empty state lays them out in a row that wraps and does nothing else to them. An action whose label is longer than its line is given the line: a Button then wraps its label, so nothing is cut and nothing runs past the block.

In a narrow column the actions take a line each, and a long label wraps

search_offCheck the spelling.Clear the searchOpen the list of contents of the documentation

Appearing in answer to something

live is for an empty state that results from what the person just did: a filter that matches no row, the last item removed. It is announced once, politely — the title, then the description, and not the actions — when it is shown and when its text changes. Keep it in the page with hidden, or add it when it applies.

A live empty state, shown in answer to a press

Apply three filters

One that is in the page’s markup and shown when the page loads is not announced then. On the web, a live empty state that your script adds to the page after it has loaded is announced; the element cannot tell one added in answer to something from one added with a new view of a single-page application, so for an empty state that is simply part of a new view, leave live off.

In a Search, the count of results is the search’s own status text, which is already announced. Where you also show an empty state in the search’s view, leave its live off, or the same words are read twice.

In a table and in a list

A table with no rows keeps its caption and its header row; the empty state stands where the body’s rows would be — in one cell that spans the columns, or directly after the table. A list with no items is not a list of one item: the empty state takes the list’s place.

Before the element is defined

The description, the title slot and the actions are the element’s own children, so they are in the document: found by search in the page, translated, selected, and read without script. @tanrei/web/empty-state.css gives an empty state that is not defined yet its paddings, its text styles and its alignment, so the words are readable where they will stand. Until then it shows without its glyph.

  • Say what is missing in the title, in plain words, and what to do in the description.
  • Offer the action that fills the place or changes what was asked for.
  • Quote what the person typed in the title of a search with no results.

Don’t

  • Don’t give it a status color or an alert’s role. An empty place is a fact about the content.
  • Don’t use live for a place that is empty when its view opens.
  • Don’t draw a centred grey sentence by hand, or a list of one item that is not an item.
  • Don’t use it for a one-line “nothing here” inside a control, such as a menu with no options: that is the control’s own text.

Accessibility

Role
none
Labeling
An empty state that is not live has no role and no name: it is content, read where it stands — the title (a heading of the level level gives, or the product's own content in the title slot as the product gave it), the description, then the actions, which are the product's own controls with their own names. A live empty state is a polite live region instead (the status role on the web), announced once when it is shown after its view was presented and when its text changes. The glyph or the picture is hidden.
Minimum target
The hit area meets the minimum target size even when the visual size is smaller. minimum 32px · pointer 44px · spacing 8px · touch 48px

Keyboard

Keys Action

Notes

  • Not interactive: the empty state takes no input and no focus (EMP-7), so there is no target of its own to size and minimumTarget holds trivially. Its actions meet the minimum target by their own specs.
  • Never an alert. An empty place is a fact about the content, not something that went wrong: it is announced only when it results from what the person just did (live), and then politely (EMP-9). A failure to load is a different thing and is said by a callout with the error status in the same place.
  • It replaces content, so it must not hide that the container is still there. A table that has no rows keeps its caption and its header; the empty state stands where the body's rows would be (on the web, outside the table element or in one cell that spans the columns, as the product's table allows). A list with no items is not exposed as a list of one item: the empty state stands in the list's place.
  • In a search, the count of results is the search's own status text, which is already a live region (SRC-48). Where the product also shows an empty state in the search's view, only one of the two is live, or the same words are announced twice: leave the empty state's live false there and let the status text speak.
  • The title is a heading (EMP-4) because it looks like one (WCAG 1.3.1). Its level is the product's to fit the page's outline: 2 by default, for the main region of a view under the page's title; deeper inside a section, a card or a panel that has a heading of its own. A product whose title must not be a heading gives it as inline content in the title slot.
  • Contrast in the default system: the title is on-surface and the description and the glyph are on-surface-variant, each held to 4.5:1 on every surface tone by the token invariants, so the empty state can stand on a page, in a card or in a panel. The glyph is decorative.
  • Say what to do, not only what is missing: a description and an action are what make an empty place a way forward. Do not put the only way forward in the picture.
  • Text size, text spacing and reflow: EMP-11.

Generated from specs/empty-state.spec.json, tokens/sys/measure.tokens.json

What the component handles

  • It is plain content with no role and no name: the title, the description, then the actions, read where they stand.
  • With live it is announced once, politely, through a status region of its own: when it is shown after the page was presented, and when its title or its description changes. It is never announced assertively.
  • The glyph or the picture is hidden from assistive technology.
  • A title given as text is a heading of the level level gives. What you give in the title slot keeps its role and its level.
  • It is not a stop in the focus order and never moves focus. Tab reaches the links of the description, then the actions.
  • With enlarged text everything wraps and grows; at a width of 320 with text at 200% nothing scrolls sideways and the actions stand each on a line of their own.
  • In forced colors the glyph, the title and the description are drawn in the text color. Nothing relies on a fill.
  • In a right-to-left layout the start is the right edge and the first action is at the right, a glyph the icon set marks is mirrored, and a title that quotes a left-to-right query keeps the query’s order.
  • An unknown size or alignment, an empty state with no title and no description, and one with a description and no title are reported in debug builds.

What you need to do

  • Write every word in the language of the page. The component supplies none.
  • Set level to fit your page’s outline, or give your own heading or text in the title slot.
  • Use live only for an empty state that appears in answer to something, and never beside another live region that says the same.
  • Do not put a control in the media slot: it is hidden from assistive technology.
  • Give an action a label that fits. A label wraps where its line is too short, but a single word longer than the line cannot.