Skip to content
Look

Shared with the landing page. Theme is the select beside this menu.

Toaster

Open .md
Live preview

Loading example…

Ephemeral, non-critical confirmations. Pass action: { label, onClick } to toast() for an undo button. Critical messages belong in a banner instead.

import { Toaster } from "@jcsoftdev/ui/overlays";

Single-component entry points tree-shake to just this component: @jcsoftdev/ui/overlays/toaster.

export const Default: Story = {
render: (args) => (
<>
<Toaster {...args} />
<Button onClick={() => toast("Cita agendada para Luis Ramírez, sábado 11:30")}>
Agendar cita
</Button>
</>
),
};

Source of the Storybook story.

Prop Type Default Description
classNames Partial<Record<ToasterPart, string>> Per-part classes merged with cn; consumer classes win. className still targets the root and is merged last.
position ToasterResponsivePosition "bottom-center"
offset ToasterOffset Distance from the edges the region is anchored to. Defaults to 1rem on both axes; y is measured from the top or the bottom edge, whichever the position uses.
duration number 6000 Default auto dismiss delay in ms; Infinity disables it.
visibleToasts number 2 Toasts shown at once; older ones wait until a newer one leaves.
className string
label string Accessible name of the region. Defaults to the notifications UI string.
container HTMLElement | null Element the region is portaled into. Defaults to document.body, which sits outside wrapper-scoped CSS variables, theme classes and dir; pass the themed root to inherit them.
dir "ltr" | "rtl" Text direction of the region. Defaults to the dir of the <html> element.

* marks a required prop.

packages/ui/src/overlays/toaster/toaster.tsx