Usage
This component acts as a Singleton - meaning you only implement a single instance (typically at the root scope of your app) and then reuse it over and over. To do this, implement the <Toast.Group> at the root scope of your app (the root layout), and use a shared createToaster() instance to trigger messages to that group from anywhere in your application.
Type
Placement
Action
Closable
Meta
Promise
API Reference
Root
card p-3 w-full md:w-md ring flex items-center gap-2 preset-filled-surface-50-950 ring-surface-200-800 data-[type=success]:preset-filled-success-500 data-[type=warning]:preset-filled-warning-500 data-[type=error]:preset-filled-error-500| Prop | Default | Type | 
|---|---|---|
toast | — | Omit<Options<any>, "id" | "parent"> | 
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
Context
| Prop | Default | Type | 
|---|---|---|
children | — | (toast: ToastApi<PropTypes, any>) => ReactNode | 
Group
| Prop | Default | Type | 
|---|---|---|
toaster | — | ToastStore<any> | 
children | — | ((toast: ToastProps<any>) => Element | null) | undefined | 
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
Message
flex-1| Prop | Default | Type | 
|---|---|---|
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
Title
font-medium text-sm| Prop | Default | Type | 
|---|---|---|
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
Description
text-sm| Prop | Default | Type | 
|---|---|---|
element | — | ((attributes: HTMLAttributes<"div">) => Element) | undefined Render the element yourself  | 
ActionTrigger
btn preset-filled| Prop | Default | Type | 
|---|---|---|
element | — | ((attributes: HTMLAttributes<"button">) => Element) | undefined Render the element yourself  | 
CloseTrigger
btn-icon hover:preset-tonal| Prop | Default | Type | 
|---|---|---|
element | — | ((attributes: HTMLAttributes<"button">) => Element) | undefined Render the element yourself  | 
Root
card p-3 w-full md:w-md ring flex items-center gap-2 preset-filled-surface-50-950 ring-surface-200-800 data-[type=success]:preset-filled-success-500 data-[type=warning]:preset-filled-warning-500 data-[type=error]:preset-filled-error-500| Prop | Default | Type | 
|---|---|---|
toast | — | Options<any> | 
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  | 
Context
| Prop | Default | Type | 
|---|---|---|
children | — | Snippet<[() => ToastApi<PropTypes, any>]> | 
Group
| Prop | Default | Type | 
|---|---|---|
toaster | — | ToastStore<any> | 
children | — | Snippet<[ToastProps<any>]> | undefined | 
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  | 
Message
flex-1| Prop | Default | Type | 
|---|---|---|
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  | 
Title
font-medium text-sm| Prop | Default | Type | 
|---|---|---|
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  | 
Description
text-sm| Prop | Default | Type | 
|---|---|---|
element | — | Snippet<[HTMLAttributes<"div">]> | undefined Render the element yourself  | 
ActionTrigger
btn preset-filled| Prop | Default | Type | 
|---|---|---|
element | — | Snippet<[HTMLAttributes<"button">]> | undefined Render the element yourself  | 
CloseTrigger
btn-icon hover:preset-tonal| Prop | Default | Type | 
|---|---|---|
element | — | Snippet<[HTMLAttributes<"button">]> | undefined Render the element yourself  |