Duolith docs

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

PropTypeDefaultMeans
titlestringWhat is missing, such as No messages yet.
messagestringWhy, or what will appear here.
iconstringinboxThe icon in the circle.
actionstringThe label of a secondary button.
onAction() => voidRuns when the button is pressed.

Children

Anything else under the button.

States

StateLooks like
defaultA large icon in a raised circle, the title, the message and the action, centred.

Accessibility

rolenone; the title is a heading
nameThe title.
focusOnly 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} />