Skip to content
Mosaic
On this page

EmptyState

The placeholder a list or table shows when it has nothing in it: an icon, a label, a description and actions.

Use for

  • an empty list or table
  • a "no results" message with an action
  • a first-run prompt to create something

Practices

GuidancePractice
DoGive EmptyState.Icon a glyph. It draws the icon in a filled frame.
Don’tUse it while content is loading. Use Skeleton instead.

API reference

EmptyState.Root

The container, as a div.

Slot: cl-empty-state

EmptyState.Icon

A span holding the glyph in a filled IconFrame. Takes no children.

Slot: cl-empty-state-icon

PropTypeDescription
glyphIconComponentThe icon to show.

EmptyState.Label

The headline, as a p.

Slot: cl-empty-state-label

EmptyState.Description

Supporting copy, as a p.

Slot: cl-empty-state-description

EmptyState.Actions

A row for buttons, as a div.

Slot: cl-empty-state-actions

Examples

No invitations

TSX
<EmptyState.Root>
  <EmptyState.Icon glyph={Envelope} />
  <EmptyState.Label>{m.emptyTitle}</EmptyState.Label>
  <EmptyState.Description>{m.emptyDescription}</EmptyState.Description>
  <EmptyState.Actions>
    <Button onClick={onInvite}>{m.invite}</Button>
  </EmptyState.Actions>
</EmptyState.Root>