EmptyState
What a screen or list shows when there is nothing in it yet, and the one thing to do about it.
Stability: experimental
Props
| Prop | Type | Default | Means |
|---|---|---|---|
title | string | What is missing, such as No messages yet. | |
message | string | Why, or what will appear here. | |
icon | string | inbox | The icon in the circle. |
action | string | The label of a secondary button. | |
onAction | () => void | Runs when the button is pressed. |
Children
Anything else under the button.
States
| State | Looks like |
|---|---|
default | A large icon in a raised circle, the title, the message and the action, centred. |
Accessibility
| role | none; the title is a heading |
| name | The title. |
| focus | Only the action takes focus. |
Theme tokens
color.raised color.muted color.ink space.3 space.6 space.10 radius.full text.heading text.body
Example
<EmptyState title="No messages yet" action="Write one" onAction={compose} />