Toast Bootstrap5

Toast Bootstrap5

Bootstrap 5 toast notifications from flash messages

Renders Bootstrap 5 toast notifications from your Yii Framework 3 application's session flash messages. Queue a message from a controller, echo $toast in your layout - no manual partials, no bundled JS asset. Requires Bootstrap 5's JS bundle to already be loaded on the page.

Options

delay array
Milliseconds before a toast auto-hides, keyed by type; null leaves it up until dismissed manually (the default for error).
icons array
Bootstrap Icon name keyed by type (requires yiirocks/svg-inline-bootstrap); null disables that type's icon.
position string
Space-separated Bootstrap position utility classes for the toast container (default: top-0 end-0).

Example

$this->toast->error('Something went wrong.');

Support

Create an issue →
Packagist Version PHP Version Downloads Last Commit GitHub Workflow Status