Skip to content

Toast

New

A short message in a corner of the screen after people do something, such as a saved file. It closes on its own, stacks with others, and swipes away.

  • Base UI
  • React 19
  • Tailwind CSS 4

Added Nov 8, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Render one Toaster in a ToastProvider near the app root, then call toast.add() from anywhere. Give a toast with an action a longer timeout, so a keyboard user can reach it.

delete-file.tsx

ToastPortal

<div>
PropTypeDefaultDescription
From Base UIToast.PortalBase UI docs
container—A parent element to render the portal element into.
className—CSS class applied to the element, or a function that returns a class based on the component's state.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ToastViewport

<div>
PropTypeDefaultDescription
position"bottom-center""bottom-end""bottom-start""top-center""top-end""top-start""bottom-end"
classNamestring—
variant"default""inverse""default"The look of every toast in this viewport: default (the popover surface) or inverse (the foreground surface). One look per stack: mixed looks in a collapsed stack show a dark card peeking out under a light one.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

Toast

<div>
PropTypeDefaultDescription
classNamestring—
swipeDirection—Directions that dismiss it. By default: toward the edge and the side of the viewport.
From Base UIToast.RootBase UI docs
toastRequiredToastRootToastObject<any>—The toast to render.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ToastContent

<div>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ToastIcon

<span>
PropTypeDefaultDescription
typestring—The toast type. success, destructive, warning, and info show an icon, loading a spinner. The error type of Base UI toast.promise shows as destructive.
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

ToastHeader

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ToastTitle

<div>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ToastDescription

<div>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ToastAction

<div>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ToastClose

<div>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ToastPositioner

<div>
PropTypeDefaultDescription
classNamestring—
From Base UIToast.PositionerBase UI docs
positionMethod"absolute""fixed"'absolute'Determines which CSS position property to use.
sideOffsetnumber | OffsetFunction0Distance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment. The function takes a data object parameter with the following properties: - data.anchor: the dimensions of the anchor element with properties width and height. - data.positioner: the dimensions of the positioner element with properties width and height. - data.side: which side of the anchor element the positioner is aligned against. - data.align: how the positioner is aligned relative to the specified side.
align"center""end""start"'center'How to align the popup relative to the specified side.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ToastArrow

<div>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

Toaster

<div>
PropTypeDefaultDescription
classNamestring—
variant"default""inverse"—The look of every toast in this viewport: default (the popover surface) or inverse (the foreground surface). One look per stack: mixed looks in a collapsed stack show a dark card peeking out under a light one.
position"bottom-center""bottom-end""bottom-start""top-center""top-end""top-start"—
container—Where the viewport renders (Base UI Toast.Portal). By default, the end of <body>.
closeLabelstring—The accessible name of each close button ("Close" by default). Translate it with the page.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

AnchoredToaster

<div>
PropTypeDefaultDescription
classNamestring—
container—Where the toasts render (Base UI Toast.Portal). By default, the end of <body>.
arrowbooleantrueShow the arrow that points at the anchor.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Use it for a short message about an action that people just did.
  • Call toast.add() from anywhere, also outside React. Render one Toaster in a ToastProvider near the app root.
  • Give a toast with an action a longer timeout, so a keyboard user can reach it.
  • For a message that must stay on the page, use an Alert.
  • For a choice that people must make before they go on, use an Alert Dialog.
F6Moves focus into the toasts and pauses every timer.
ShiftTabMoves focus back out of the toasts.
EscCloses the focused toast.

The viewport is a Base UI Toast.Viewport: a landmark with role="region" and aria-live="polite". Base UI names it "Notifications" in English. Pass a translated aria-label.

Each toast is a role="dialog", named by its title. A toast with priority: "high" is an alertdialog, and a screen reader reads it at once. A low toast (the default) is read after the current speech.

The status icon is aria-hidden, because the title says the same thing in words. The close button is named "Close". Set closeLabel on Toaster to translate it.

F6 moves focus into the toasts and pauses every timer. Hover also pauses them. Swipe is never the only way out: the close button and the timeout also remove a toast. The close button and the action are 24px, with a 44px target on touch (hit-area).

Enter and stack
toast · 300ms · ease-panel (0.2, 0.4, 0.2, 1)
Close
toast-exit · 150ms · ease-out (0, 0, 0.2, 1)
Anchored toast
popup · 150ms · ease-panel (0.2, 0.4, 0.2, 1)

Built with

Installs with Toast

Components
Button,Spinner
  1. AddedToast, with Button, Spinner.
Open the release