Tally UI
Primitives

Toast

A brief, non-blocking notification that appears temporarily.

Import

import { Toast } from '@tallyui/primitives';

Usage

<Toast.Root open={open} onOpenChange={setOpen} type="foreground">
  <Toast.Title>Item saved</Toast.Title>
  <Toast.Description>Your changes have been saved.</Toast.Description>
  <Toast.Action altText="Undo save">
    <Text>Undo</Text>
  </Toast.Action>
  <Toast.Close>
    <Text>Dismiss</Text>
  </Toast.Close>
</Toast.Root>

Components

Toast.Root

Container for a single toast notification.

PropTypeDefaultDescription
openbooleanControlled open state
defaultOpenbooleantrueInitial state (uncontrolled)
onOpenChange(open: boolean) => voidCalled when open state changes
type'foreground' | 'background''foreground'Urgency level for screen readers
asChildbooleanfalseMerge props onto child instead of rendering

Plus all React Native ViewProps.

Toast.Title

The toast heading.

PropTypeDefaultDescription
asChildbooleanfalseMerge props onto child instead of rendering

Plus all React Native TextProps.

Toast.Description

The toast body text.

PropTypeDefaultDescription
asChildbooleanfalseMerge props onto child instead of rendering

Plus all React Native TextProps.

Toast.Action

A pressable action inside the toast. Must include altText for accessibility.

PropTypeDefaultDescription
altTextstringrequiredAccessible label describing what the action does
asChildbooleanfalseMerge props onto child instead of rendering

Plus all React Native PressableProps.

Toast.Close

A pressable that dismisses the toast.

PropTypeDefaultDescription
asChildbooleanfalseMerge props onto child instead of rendering

Plus all React Native PressableProps.

Accessibility

  • Toasts are announced via a live region
  • type="foreground" maps to aria-live="assertive", type="background" maps to aria-live="polite"
  • The altText on Action provides a screen-reader-friendly description of the action

On this page