BrickclayDesign System

Toastr

BkToastrService + bk-toastr, an imperative toast system. The container mounts itself on document.body the first time you call the service, so there is nothing to place in a template.

BkToastrServiceMessaging and overlaysAngular

Preview

A working preview of Toastr in the Brickclay style. Try it.

Interact with the preview to see events here.

Interactive playground

this.toastr.show({
  summary: 'Client added successfully.',
  severity: 'success',
  actionLabel: 'Undo',
  actionCallback: () => { /* ... */ },
});

Action callback log

Set an actionLabel, click "Show toast", then click the action button on the toast itself to see actionCallback fire here.

Toast options (ToastConfig)

OptionTypeDefaultDescription
summarystring–Required. The bold headline text.
detailstring–Optional secondary line under the summary.
severityToastSeverity'info'info, success, error, warn, default.
timeOutnumber (ms)4000Auto-dismiss delay. Ignored when sticky is true.
stickybooleanfalseDisables the auto-dismiss timer; only close() or the × removes it.
iconbooleantrueShows the leading status icon.
inlinebooleantrueBelow 425px width, false wraps to a 2-row grid instead of staying on one line.
actionLabelstring–Shows a secondary action button with this label.
actionCallback() => void–Fires when the action button is clicked.

API reference

Service memberDescription
show(config)Full control: summary, detail, severity, timeOut, sticky, icon, inline, actionLabel/actionCallback.
success / error / warn / info / default(summary, detail?)Convenience wrappers around show().
close(id) / clear()Dismiss one toast, or all of them.
setPosition(position)One of the 6 corner/center positions; applies to all toasts.