Notification Presets
Faststrap includes lightweight notification presets built on Toast and Alert.
These presets help teams standardize feedback UX across apps without rebuilding notification patterns per project.
Import
from faststrap import (
NoticeToast, NoticeAlert,
SuccessToast, ErrorToast, WarningToast, InfoToast
)
Toast presets
SuccessToast("Profile saved")
ErrorToast("Request failed")
WarningToast("Storage almost full")
InfoToast("New update available")
Why this is useful
- Faster implementation of common success/error/warning/info states.
- Consistent message styles across pages and features.
- Keeps code readable (
SuccessToast("Saved")is clearer than repeating variant setup).
Common use cases
- CRUD feedback after save/delete/update.
- Auth events (signed in, session expired).
- Form submission status.
- Background task/result notifications.
Generic toast
Alert preset
Choosing toast vs alert
- Use toast for transient, non-blocking feedback.
- Use alert for inline, persistent feedback near related UI.
Note
For HTMX out-of-band responses, continue using:
with a ToastContainer in your page layout.