Skip to content
Storybook

Toast

Brief confirmation that appears at the bottom-start corner and dismisses after 5 seconds.

Preview

React · live from the Storybook
Toast preview

HTML and CSS

The same component as plain HTML with pixels-ui.css, no framework needed.

Usage

  • One action at most; never the only path to a feature.
  • Pauses on hover.

Installation

Included in the core files. No extra install.

HTML
<link rel="stylesheet" href="/css/pixels-tokens.css">
<link rel="stylesheet" href="/css/pixels-ui.css">
<script src="/js/pixels-ui.js" defer></script>

Examples

Static

What the JS renders.

Changes saved

API reference

Class / attributeTypeDescription
PixelsUI.toast({ message, tone, action, onAction, duration })JSShows a toast.
data-px-toast="message" data-tone data-actionattributeDeclarative trigger.

Figma properties

Toast6 variants · page “Alerts & Notifications”Open

Brief confirmation that appears at the bottom (start corner on desktop) and dismisses after 5–8s; pause on hover. Announce with aria-live=polite. Only one action, never the only path to a feature. Mes…

PropertyTypeValues
MessageText“Message archived”
ActionBoolean—
Action labelText“Undo”
ToneVariantNeutral Success Danger
DirectionVariantLTR RTL

Design tokens

Component tokens from the Figma Component collection. Override them to restyle just this component.

TokenAliasLight value
--px-toast-radiusradius-1616px
--px-toast-paddingspacing-1616px
--px-toast-gapspacing-1212px

Accessibility

  • Announced with aria-live="polite".