spz-toast
When to Use
- To provide feedback information such as success, warning, and error.
- Centered on the page and disappearing automatically, it is a non-intrusive, lightweight way of notifying users.
Code Demonstration
Basic
The simplest usage, use the showToast method to open a notification.
The notification popup will close when clicking outside the popup area or when the scroll distance exceeds the height of the popup, or the delay exceeds the set time.
Modify Delay
Modify the automatic closing delay time of the popup by changing the duration attribute of the element.
Modify the automatic closing delay time of the popup by configuring the duration parameter of the showToast method.
Customize Content Position
Control the position of content in the notification popup by adding a child element with the role="content" attribute inside the element.
Form Notification
In a form, when the notification element has validation-for and visible-when-invalid attributes and the validation status matches the value of visible-when-invalid, the notification popup will automatically display.
Properties
Methods
showToast
Open the notification popup.
AI Summary (LLM Ready)
- Component ID:
spz-toast - One-line purpose: Display operation feedback notifications.
- Detected attribute rows: 0
- Detected method subsections: 1
- Detected event subsections: 0
- Top attribute names: none (needs manual completion)
- Top method names:
showToast - Top event names: none (needs manual completion)
- Reading order: start from usage/examples, then verify attributes, methods, and events.
- Related docs: /en/guide/actions-and-events/ , /en/guide/layouts/