Toast
Accessible toasts with stacking, gestures, and animations
Toast presents time-sensitive messages with accessible announcements, stacking, gestures, and animated entry or exit.
Features
Composable component API
Smooth stacking with hover-to-expand
Swipe dismissal with spring physics
Promise toasts for async operations
All Tamagui animation drivers supported
Installation
Toast ships with tamagui: there’s nothing extra to install:
If you’re using the unstyled primitives directly, it’s also published on its own:
yarn
npm
bun
pnpm
Native OS toasts are opt-in. By default toasts render as in-app Tamagui views on every platform, so adding Toast to your app never pulls in a native dependency. See Native toasts if you want the real iOS/Android system toast.
Quick start
Toast is a composable component API: you mount the parts, and toast() drives
them from anywhere in your app.
Mount this inside your TamaguiProvider, usually next to your app navigation or
root layout. toast() is global, so callers don’t need to be inside <Toast>.
<Toast.List /> renders the default styled toast. Pass renderItem to own the
markup completely:
Omit renderItem and Toast.List renders the default styled toast content.
Anatomy
API reference
toast()
The imperative toast function:
toast.promise()
For async operations:
Toast (Root)
Props
position
'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'
Default:
'bottom-right'Position of the toast viewport.
duration
number
Default:
4000Default toast duration in milliseconds.
gap
number
Default:
14Gap between toasts when expanded.
visibleToasts
number
Default:
4Maximum number of visible toasts.
swipeDirection
'auto' | 'left' | 'right' | 'up' | 'down'
Default:
'auto'Swipe direction to dismiss. 'auto' detects based on position.
closeButton
boolean
Default:
falseShow close button on toasts.
native
boolean
Default:
falseUse the native OS toast on iOS/Android instead of in-app views. Requires burnt.
Toast.Viewport
The portal container for toasts. Extends View.
Props
offset
number | { top?: number, right?: number, bottom?: number, left?: number }
Default:
16Offset from screen edge.
hotkey
string[]
Default:
['altKey', 'KeyT']Hotkey to focus viewport.
label
string
Default:
'Notifications'Aria label for the viewport.
Toast.Item
Individual toast wrapper with stacking and drag support. Extends View.
Props
toast (required)
ToastT
The toast data object.
index (required)
number
Index in the toast list (for stacking).
Supports render prop for custom content:
Toast.Title
Styled text for the toast title. Extends SizableText.
Toast.Description
Styled text for the toast description. Extends SizableText.
Toast.Close
Close button. Extends View.
Toast.Action
Action button. Extends View.
useToasts
Hook to access toast state from a descendant of <Toast>. Most apps should use <Toast.List> for rendering and reach for this hook only when they need custom list control.
Features
Stacking
Multiple toasts stack visually. Hover over the stack to expand and see all toasts.
Swipe to dismiss
Toasts can be swiped away. The direction is auto-detected based on position:
- Web: Left/right positioned toasts swipe toward their edge, center toasts swipe horizontally
- Native: All positions swipe vertically (up/down) to avoid conflicting with iOS/Android navigation back gesture
When react-native-gesture-handler is set up via @tamagui/native/setup-gesture-handler, the toast uses native gesture coordination (activeOffsetY, failOffsetX) to prevent ScrollView from scrolling while swiping.
Native toasts
Toasts render as in-app Tamagui views on every platform by default. To use the real iOS/Android system toast instead, install Burnt and import its setup module at your app entry:
yarn
npm
bun
pnpm
Then opt in on the root:
Burnt is resolved lazily, so apps that don’t set it up never load it and never need the native module.
Native safe area
On native, toasts portal to root and automatically respect safe area insets (status bar, Dynamic Island, home indicator) when configured:
The toast reads insets from TamaguiProvider via useConfiguration().insets, the same mechanism used by other Tamagui components like Slider.
Custom styling
Each part can be styled independently:
Migrating from v2
The v2 imperative API (ToastProvider, ToastViewport, useToastController, useToastState) was removed. Replace the provider tree with the composable parts shown above, and call toast() directly instead of going through a controller hook:
See the upgrade guide for the full migration.