Skip to content

The toast() stack.

import { BbToast } from 'bitboss-ui';

On this page

Props

NameDescription
pt Type: (PtCompoundOf<"", { readonly parts: readonly ["root", "panel", "icon", "content", "title", "text", "footer", "action", "close"]; readonly states: readonly ["loading"]; readonly wide: readonly []; readonly node: { readonly panel: readonly ["loading"]; readonly icon: readonly ["loading"]; readonly content: readonly ["loading"]; readonly title: readonly ["loading"]; readonly text: readonly ["loading"]; readonly footer: readonly ["loading"]; readonly action: readonly ["loading"]; readonly close: readonly ["loading"]; }; readonly variant: { readonly names: readonly ["default", "success", "info", "warning", "destructive"]; readonly option: "toastVariants"; readonly parts: readonly ["panel", "icon", "content", "title", "text", "footer", "action", "close"]; }; }> & PtMap<BbToastPtPart, never> & { "title:destructive"?: PtValue | undefined; "title:warning"?: PtValue | undefined; "text:destructive"?: PtValue | undefined; "text:warning"?: PtValue | undefined; "icon:destructive"?: PtValue | undefined; "icon:warning"?: PtValue | undefined; "close:destructive"?: PtValue | undefined; "close:warning"?: PtValue | undefined; "text:loading"?: PtValue | undefined; "icon:loading"?: PtValue | undefined; "panel:loading"?: PtValue | undefined; "footer:default"?: PtValue | undefined; "footer:destructive"?: PtValue | undefined; "title:default"?: PtValue | undefined; "text:default"?: PtValue | undefined; "close:default"?: PtValue | undefined; "content:default"?: PtValue | undefined; "content:destructive"?: PtValue | undefined; "action:default"?: PtValue | undefined; "action:destructive"?: PtValue | undefined; "footer:loading"?: PtValue | undefined; "title:loading"?: PtValue | undefined; "close:loading"?: PtValue | undefined; "content:loading"?: PtValue | undefined; "action:loading"?: PtValue | undefined; "footer:warning"?: PtValue | undefined; "footer:success"?: PtValue | undefined; "footer:info"?: PtValue | undefined; "title:success"?: PtValue | undefined; "title:info"?: PtValue | undefined; "text:success"?: PtValue | undefined; "text:info"?: PtValue | undefined; "icon:default"?: PtValue | undefined; "icon:success"?: PtValue | undefined; "icon:info"?: PtValue | undefined; "panel:default"?: PtValue | undefined; "panel:destructive"?: PtValue | undefined; "panel:warning"?: PtValue | undefined; "panel:success"?: PtValue | undefined; "panel:info"?: PtValue | undefined; "close:success"?: PtValue | undefined; "close:info"?: PtValue | undefined; "content:warning"?: PtValue | undefined; "content:success"?: PtValue | undefined; "content:info"?: PtValue | undefined; "action:warning"?: PtValue | undefined; "action:success"?: PtValue | undefined; "action:info"?: PtValue | undefined; })

Passthrough, object form: the same keys as the pt:* attributes without the prefix. See the pt:<part> row.

pt:<part> Type: PtValue

Passthrough, attribute form: one attribute per part, pt:<part>, and per part and state, pt:<part>:<state>. Parts: action, close, content, footer, icon, panel, root, text, title. States: default, destructive, info, loading, success, warning.

Not attributes on a tag: there is no <BbToast /> to write them on. These parts are the keys of components.BbToast.pt in the plugin config, which styles every toast the app shows: panel (the card), icon, content, title, text, footer (the actions row), action (each button) and close, plus a per-toast loading state (pt:panel:loading). A portal toast has no icon, title, text, footer or action.

See example

Renamed and removed

Names from v2 and from earlier 3.0 betas that no longer work, and what to write instead.

  • optionactions[].iconactions[].iconOnlyfails silently

    An icon-only action writes its label and icon: { text: 'Undo', 'prepend:icon': 'lucide:undo-2', iconOnly: true }; the label is the accessible name.

  • placementpositionfails silently

    The host is <BbHost /> now and takes no props: set the plugin's toastPosition (corner names: top-end → top-right, bottom → bottom-center, …)

  • optionshowClosehideClosefails silently

    A toast() option, polarity inverted: showClose: false → hideClose: true; showClose: true was the default, delete it.

  • optionthemevariantfails silently

    A toast() / useToast().toast() option, not a prop: toast({ variant: 'success' }) (plus an icon for the tone to show)

  • optiontimeoutdurationfails silently

    A toast() option: toast({ duration: 4000 }); the default fell from 6000 to 4000 ms.