Toast
Base UITransient notifications powered by Sonner.
ReadyResponsive
Usage
Package export"use client";
import { Button } from "@jnpll/elements-ui/button";
import { Toaster, toast } from "@jnpll/elements-ui/sonner";
export default function ToastDemo() {
return <><Toaster /><Button onClick={() => toast.success("Changes saved", { description: "Your workspace is up to date." })}>Show notification</Button></>;
}
Examples
Default composition
"use client";
import { Button } from "@jnpll/elements-ui/button";
import { Toaster, toast } from "@jnpll/elements-ui/sonner";
export default function ToastDemo() {
return <><Toaster /><Button onClick={() => toast.success("Changes saved", { description: "Your workspace is up to date." })}>Show notification</Button></>;
}
API Reference
| Prop | Type / description | Default |
|---|---|---|
children | ReactNodeComponent content and composition slots. | - |
className | stringAdditional classes, merged with the component styles. | - |
Composition & accessibility
Import the composition slots shown in the example. Keep labels and descriptions meaningful; interactive primitives provide keyboard and focus behavior. See the source for the complete typed API.