Bloc UIBloc UI

Toast

Service-driven toast notifications. Inject BlocToastService and call its methods to show notifications.

$ npm install @bloc-ui/toast

Setup

Inject the service

BlocToastService is provided in root — just inject it in your component.

Add the container

Place the toast container component once in your root template.

Types

Info

Default type for general messages.

Success

Confirms a completed action.

Warning

Alerts the user to a potential issue.

Error

Reports a failure or error.

Options

Persistent (no auto-dismiss)

Set duration: 0 to keep the toast until manually dismissed.

Non-dismissible

Set dismissible: false to hide the close button.

Dismiss all

Clear all visible toasts at once.

Theming

Custom token

Override toast colours via CSS custom properties on the container.