Toast

An opinionated toast component. Auto-dismissing, stackable, swipeable. Consumes @flash automatically — existing put_flash/3 calls render as toasts with zero code changes.

Default

Click the button to trigger a basic toast.

Types

Four toast types: success, info, warning, error. Each has a distinct icon and color.

With Description

Toasts can include a secondary description below the title.

With Action Button

Add an action button that pushes an event back to the server. The counter below shows it works.

Persistent

Set duration: 0 to make a toast that stays until manually dismissed.

Flash Integration

put_flash(:info, ...) and put_flash(:error, ...) are automatically rendered as toasts. Zero code changes required.

Rich push_event

Use toast/4 for full control: description, action button, and custom duration.