Feedback
Provider-based toast notification system with a promise-aware API.
13 options across 4 groups
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Your app, rendered inside the provider. |
children
ReactNode
Default: —
Your app, rendered inside the provider.
| Prop | Type | Default | Description |
|---|---|---|---|
position | "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | "bottom-right" | Where the toast region renders. |
maxToasts | number | 12 | Total toasts kept in the queue (visible + pending). |
maxVisibleToasts | number | 3 | Toasts shown at once before stacking/queuing. |
toastOffset | number | 0 | Extra offset from the viewport edge. |
container | Element | DocumentFragment | null | — | Custom portal mount target. |
position
"top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right"
Default: "bottom-right"
Where the toast region renders.
maxToasts
number
Default: 12
Total toasts kept in the queue (visible + pending).
maxVisibleToasts
number
Default: 3
Toasts shown at once before stacking/queuing.
toastOffset
number
Default: 0
Extra offset from the viewport edge.
container
Element | DocumentFragment | null
Default: —
Custom portal mount target.
| Prop | Type | Default | Description |
|---|---|---|---|
defaultDuration | number | 6000 | Auto-dismiss duration in ms, unless overridden per-toast or persistent. |
toastProps | ToastOptions | — | Default options applied to every toast from this provider. |
defaultDuration
number
Default: 6000
Auto-dismiss duration in ms, unless overridden per-toast or persistent.
toastProps
ToastOptions
Default: —
Default options applied to every toast from this provider.
| Prop | Type | Default | Description |
|---|---|---|---|
motion | "auto" | "reduced" | "default" | "auto" | Animation mode; "auto" respects prefers-reduced-motion. |
disableAnimation | boolean | false | Disables all toast animation. |
motion
"auto" | "reduced" | "default"
Default: "auto"
Animation mode; "auto" respects prefers-reduced-motion.
disableAnimation
boolean
Default: false
Disables all toast animation.
| Prop | Type | Default | Description |
|---|---|---|---|
regionProps | ToastRegionProps | — | Extra props for the toast region container. |
className | string | — | Class applied to the toast region. |
style | CSSProperties | — | Inline styles for the toast region. |
regionProps
ToastRegionProps
Default: —
Extra props for the toast region container.
className
string
Default: —
Class applied to the toast region.
style
CSSProperties
Default: —
Inline styles for the toast region.
| Prop | Type | Default | Description |
|---|---|---|---|
title | ReactNode | — | Toast title. |
description / message | ReactNode | — | Toast body content. |
icon | ReactNode | — | Overrides the default type-derived icon. |
endContent | ReactNode | — | Content rendered at the end of the toast. |
action | { label: string; onClick?: () => void } | — | An inline action button. |
title
ReactNode
Default: —
Toast title.
description / message
ReactNode
Default: —
Toast body content.
icon
ReactNode
Default: —
Overrides the default type-derived icon.
endContent
ReactNode
Default: —
Content rendered at the end of the toast.
action
{ label: string; onClick?: () => void }
Default: —
An inline action button.
| Prop | Type | Default | Description |
|---|---|---|---|
type | "default" | "info" | "success" | "warning" | "error" | "loading" | derived from color, else "default" | Semantic type, also picks the default icon. |
color | ToastColor | — | Semantic color. |
variant | "solid" | "soft" | "flat" | "bordered" | "flat" | Visual style variant. |
radius | OksRadius | "md" | Border radius. |
size | OksSize | "md" | Toast size. |
type
"default" | "info" | "success" | "warning" | "error" | "loading"
Default: derived from color, else "default"
Semantic type, also picks the default icon.
color
ToastColor
Default: —
Semantic color.
variant
"solid" | "soft" | "flat" | "bordered"
Default: "flat"
Visual style variant.
radius
OksRadius
Default: "md"
Border radius.
size
OksSize
Default: "md"
Toast size.
| Prop | Type | Default | Description |
|---|---|---|---|
position | ToastPosition | provider's position | Per-toast position override. |
position
ToastPosition
Default: provider's position
Per-toast position override.
| Prop | Type | Default | Description |
|---|---|---|---|
duration | number | null | 6000 | Auto-dismiss duration in ms; null disables auto-dismiss. |
persistent | boolean | false | Never auto-dismisses. |
showDurationBar | boolean | false | Shows a countdown progress bar. |
dismissible | boolean | true | Shows a close button. |
promise | Promise<unknown> | — | Drives the promise-aware loading/success/error flow. |
duration
number | null
Default: 6000
Auto-dismiss duration in ms; null disables auto-dismiss.
persistent
boolean
Default: false
Never auto-dismisses.
showDurationBar
boolean
Default: false
Shows a countdown progress bar.
dismissible
boolean
Default: true
Shows a close button.
promise
Promise<unknown>
Default: —
Drives the promise-aware loading/success/error flow.
| Prop | Type | Default | Description |
|---|---|---|---|
onDismiss | (id: ToastId) => void | — | Called when the toast is dismissed. |
onDismiss
(id: ToastId) => void
Default: —
Called when the toast is dismissed.
| Prop | Type | Default | Description |
|---|---|---|---|
closeIcon | ReactNode | — | Overrides the default close icon. |
classNames | ToastClassNames | — | Per-slot class overrides. |
className | string | — | Class applied to this toast's root element. |
closeIcon
ReactNode
Default: —
Overrides the default close icon.
classNames
ToastClassNames
Default: —
Per-slot class overrides.
className
string
Default: —
Class applied to this toast's root element.