Skip to content

Toast

Toasts as a deck at the bottom end: hover or focus fans out the history, ↩ undoes (⌘Z), a flick dismisses.

Base UI6.4 kB gzipSource Registry JSON

toast playground

Props

tone

Installation

npx shadcn@latest add https://sproutboat.com/ikada/r/toast.json

The CLI writes components/ikada/toast.tsx and merges the ikada theme into your CSS. It also installs the components it is built from: Button, Status Glyph and Tooltip. Or take it from the package: import { ToastProvider } from "@sproutboat/ikada";

Usage

import { ToastProvider } from "@/components/ikada/toast";

<Button onClick={() => toast.add({ tone: "success", title: "Deployed", description: "robin is live." })}>Show toast</Button>

Examples

Tones

Hover the stack to fan it out. Alt+T focuses it.

Actions

A ghost action is plain underlined text; a danger one is a red button.

In progress

busy spins the glyph and progress draws the line. Update a toast in place by reusing its id.

Props

ToastProviderProps
PropTypeDescription
onToast((event: ToastEvent) => void)The history hook: called for every add, merge, update and close. For an Activity feed or a bell.
limitnumberToasts kept on screen at once; older ones are dropped. Default 5.
labelstringAccessible name of the region. Default `Notifications (Alt+T)`.

Source: src/components/toast.tsx