Duolith docs

Banner

A message across a screen or a section, in a tone, with an optional action and a dismiss button.

Stability: experimental

Props

PropTypeDefaultMeans
titlestringWhat happened, in a few words.
messagestringMore about it, under the title.
tone"info" | "success" | "danger"infoIts colour and icon; a danger banner is announced at once.
actionstringThe label of a button under the message.
onAction() => voidRuns when the action is pressed.
onDismiss() => voidShows a dismiss button, and runs when it is pressed.

States

StateLooks like
defaultA tinted panel with the tone's icon, the title and message, and its action.

Accessibility

rolestatus, or alert for the danger tone
nameIts title and message are read as text.
focusTab reaches the action, then the dismiss button.
keyboardEnter and Space press them.

Theme tokens

color.primary color.success color.danger color.surface color.border color.ink color.muted space.1 space.3 space.4 radius.full text.label text.caption

Example

<Banner title="You are offline" message="Changes are saved on this phone." tone="danger" />