Toast
OverlaysTransient notification messages via Sonner.
Two exports: <Toaster /> (the provider — add once near your app root) and the toast() imperative function for triggering notifications. Built on Sonner 2.x with full brand overrides.
Usage
import { Toaster, toast } from "nosible-ux"
// Add once in your app root:
// <Toaster />
// Trigger anywhere:
export default function Example() {
return (
<Button intent="primary" onClick={() => toast.success("Signal exported")}>
Export signals
</Button>
)
}Examples
Toast types
With action button
Accessibility
Sonner uses role="status" for non-critical toasts and role="alert" for errors. Toasts auto-dismiss after the default duration (4s) or the configured duration.
Props
| Name | Type | Default | Description |
|---|---|---|---|
className | string | undefined | — | |
closeButton | boolean | undefined | — | |
containerAriaLabel | string | undefined | — | |
dir | "auto" | "ltr" | "rtl" | undefined | — | |
duration | number | undefined | — | |
expand | boolean | undefined | — | |
gap | number | undefined | — | |
hotkey | string[] | undefined | — | |
icons | ToastIcons | undefined | — | |
id | string | undefined | — | |
invert | boolean | undefined | — | |
mobileOffset | Offset | undefined | — | |
offset | Offset | undefined | — | |
position | Position | undefined | — | |
richColors | boolean | undefined | — | |
style | CSSProperties | undefined | — | |
swipeDirections | SwipeDirection[] | undefined | — | |
theme | "light" | "dark" | "system" | undefined | — | |
toastOptions | ToastOptions | undefined | — | |
visibleToasts | number | undefined | — |