Toast
Toast displays brief, temporary notifications that provide feedback without interrupting the user's workflow. It supports automatic closing, manual closing, stacking, progress bars, ESC key closing, responsive viewport adaptation, and show/hide animations.
BrToast uses BrConfigProvider for global theme configuration (colors, radius, shadows, z-index, etc.), and supports both component-based and function-based invocation.
Component Features
- ⏱️ Auto Close: Supports both auto-close and manual close modes.
- 📚 Stacking: Supports multiple Toasts displaying simultaneously.
- 📊 Progress Bar: Optional close progress bar showing remaining time.
- ⌨️ Keyboard Close: Supports ESC key to close.
- 📐 8 Positions: Supports
top/top-left/top-center/top-right/bottom/bottom-left/bottom-center/bottom-right. - 🎨 Multiple Variants: Supports Default, Primary, Success, Error, Warning, Info visual styles.
- 🎨 Theme Configuration: Based on
BrConfigProviderfor global theming (colors, radius, shadows, z-index tokens).
Basic Usage
Click the button to show a default Toast (auto-close + manual close).
Variants
Use the variant prop to control the visual style of the Toast:
- Default: Default style
- Primary: Primary style
- Success: Success style
- Error: Error style
- Warning: Warning style
- Info: Info style
Positioning & Stacking
Supports 8 positions (top/top-left/top-center/top-right/bottom/bottom-left/bottom-center/bottom-right), along with stacking and progress bars.
Theming
Use BrConfigProvider to globally configure default position, radius, shadow, variant colors, and z-index. You can also use utility classes for local overrides.