Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

Toast

  • Stable
  • WCAG 2.2 evidence
  • RTL

Gives the components below it a toast queue through useToast() and renders its ToastRegion. Use it instead of the shared toast queue when toasts belong to one part of the app, or to keep tests and server requests isolated.

import { Toast } from "@nexera-ui/react";
Loading example…
4
examples
9
props
1
live controls
1
platform
13
WCAG criteria
0
blocks use it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
children
Generated code
import { Toast } from "@nexera-ui/react";

<Toast />

Examples 3

The same examples as Storybook, rendered live. Open Code to copy one.

Stack

Three toasts kept open in the real region: bottom edge on narrow screens, bottom end corner from 480 px.

Loading example…

Long content

Long titles and descriptions wrap inside the 380 px toast (translation adds 30 to 40 %).

Loading example…

Right to left

Right-to-left: the stack moves to the bottom left corner and the icon, text and buttons mirror.

Loading example…

Props 9

Press "Try it" on a card to load that prop into the playground.

9 props shown

childrenNexera
ReactNode

The app, or the part of it that adds toasts with useToast().

Default –
queueNexera
ToastQueue

The queue to show and to return from useToast(). Defaults to a queue of the provider's own (created once).

Default createToastQueue()
maxVisibleToastsNexera
number

Toasts shown at the same time when the provider creates its own queue; later ones wait.

Default 3
closeLabelNexera
string

Accessible name of every toast's close button. Translate it for your locale.

Default Close
aria-labelNexera
string

Accessible name of the landmark region. Defaults to React Aria's localised count, for example "2 notifications.".

Default –
classNameNexera
string

Extra classes for the region, merged last so they win over the defaults (for example another corner).

Default –
styleNexera
CSSProperties

Inline style for the region.

Default –
aria-labelledbyReact Aria
string

Identifies the element (or elements) that labels the current element.

Default –
aria-describedbyReact Aria
string

Identifies the element (or elements) that describes the object.

Default –

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

WCAG 2.2 evidence

8 direct · 5 supporting
  • 1.1.1Non-text ContentLevel A · tested directly
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.3.2Meaningful SequenceLevel A · supporting test
  • 1.4.1Use of ColorLevel A · tested directly
  • 1.4.10ReflowLevel AA · supporting test
  • 2.1.1KeyboardLevel A · tested directly
  • 2.2.1Timing AdjustableLevel A · tested directly
  • 2.3.3Animation from InteractionsLevel AAA · supporting test
  • 2.4.3Focus OrderLevel A · tested directly
  • 2.4.7Focus VisibleLevel AA · supporting test
  • 2.5.8Target Size (Minimum)Level AA · supporting test
  • 4.1.2Name, Role, ValueLevel A · tested directly
  • 4.1.3Status MessagesLevel AA · tested directly

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

  • data-hovered
  • data-pressed
Usage
<Toast className="data-hovered:opacity-90 shadow-sm" />

Used in blocks

No block uses Toast yet.

Related components