bit Bheadless

Toast

Short, non-blocking notifications — queued from anywhere, announced to screen readers, dismissed automatically.

Implementation: CSS Tailwind

Simple toast

Inject BitBhToaster (registered by AddBitBheadlessServices()) and call Show. Toasts appear in a BitBhToastViewport — a role="region" landmark labelled "Notifications (F8)"; press F8 to jump to it. Every toast is announced through the shared live region, auto-dismisses after the viewport's Duration (paused while hovered or focused) and closes with Escape or a BitBhToastClose.

With a description

Pass a description and render it with BitBhToastDescription. Title and description are announced together ("Changes saved. Your profile is now visible…"). Data carries anything your template needs — here a variant that picks the icon.

With an action

Set ActionLabel and OnAction; BitBhToastAction renders the button, runs the callback and dismisses the toast. Toasts disappear, so keep the action reachable elsewhere too — here "Restore all" stays on the page.

  • Quarterly report
  • Team offsite plan
  • Invoice #1042

Foreground (assertive) error

Toasts are background (role="status", announced politely) by default. Set Foreground = true for the direct result of a user action that needs attention: it is announced assertively and the toast gets data-type="foreground".

Custom duration and persistent toasts

Duration (ms) on a toast overrides the viewport's default (5000 ms). Duration = 0 keeps the toast until it is dismissed. Clear() dismisses every toast.

Stacking with Limit

BitBhToaster.Limit (default 5) caps how many toasts are kept — the oldest is dropped when a new one arrives. This demo creates its own toaster with Limit = 3 and renders it in a second viewport (passed through Toaster, bottom-left, Shift+F8) styled as a stack that fans out on hover or keyboard focus.

Shown: 0 of max 3
      An unhandled error has occurred. Reload 🗙