2.0 alpha
These docs describe 2.0. Install it with @once-ui-system/core@alpha.
On 1.8.x? Read the 1.x docs
TrademarkTrademarkDocs
Ctrl k
Search docs...
Contexts

ToastProvider

Updated: June 30, 2026
View on GitHub
The ToastProvider wraps your app to provide access to useToast, allowing any component to trigger lightweight, dismissible toast messages globally. Wrap your app with ToastProvider to activate toast functionality. We recommend using a Providers component to wrap your app. You can choose to display toasts at the top or bottom based on breakpoints. Use the useToast() hook to display notifications from anywhere in your app: The ToastProvider automatically renders a <Toaster /> under the hood, passing it the current list of toasts and a removeToast handler.
Prop
Type
Default
toasts
Toast[]
addToast
(toast: { message: ReactNode; variant: 'success' | 'danger' | 'warning' | 'info'; action?: ReactNode }) => void
removeToast
(id: string) => void
Prop
Type
Default
id
string
variant
successdangerwarninginfo
message
ReactNode
action
ReactNode
Prop
Type
Default
children
React.ReactNode
xl
topbottom
l
topbottom
m
topbottom
s
topbottom
xs
topbottom
Edit this page on GitHub
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club