- Components
- dissmissible
Dissmissible
User-dismissible content wrapper for alerts, notifications, and temporary messages.
Demo
Create dismissible content that users can close or hide. Commonly used for alerts, notifications, banners, and temporary messages.
Installation
Install the component
-
Install the component
Shellphp artisan flexi:add dissmissible -
Install dependencies
This component requires JavaScript. By default we use the interactive component library Flexilla .Shellnpm i @flexilla/dissmissible -
Setup
Add the plugin to your
resources/js/app.jsflexilla.jsimport { DissmissiblePlugin } from "./plugins/dissmissible"; Alpine.plugin(DissmissiblePlugin)
API Reference
| Prop | Description |
|---|---|
action
(string)
|
Determines what happens when dismissed. Default is
'remove-from-dom'
which removes the element from the document. Other options depend on your JavaScript setup.
|
closable
(boolean)
|
Controls whether the close button is displayed. Default is
true
.
|
slot
(HTML)
|
The main content to be displayed inside the dismissible component.
|
Examples
Alert Notification
Dismissible alert notifications for errors, warnings, and general information messages.
Custom close button
The data export you requested is ready!
Composition
| Prop | Description |
|---|---|
x-ui.dissmissible
|
The main dismissible container component |
x-ui.dissmissible.close
|
The close button component (automatically included when closable
is true
)
|