Overview
Temporary overlay notification.Import
Usage
Live Preview
Run Locally
npm run tsx:core-gallery
Props
- text: string — Message text.
- durationMs?: number — Auto-close timeout in ms (default 2000; set 0 to disable).
- type?: ‘info’ | ‘success’ | ‘warning’ | ‘error’ — Visual accent.
- position?: ‘top’ | ‘bottom’ | ‘center’ — Vertical position.
- closable?: boolean — Enables key to close (Esc/q/Enter/Space).
- onClose?: () => void — Called when closed.
- BaseProps: position, variant, size, label, borderStyle.
Methods
- setText(text), setType(type), setDuration(ms), setPosition(pos), setClosable(bool).
- show(), hide(), close(), pause(), resume().
- getText(), getType().
Keyboard
- Esc, q, Enter, Space: close (if closable).
Theming
- Uses BaseProps variant/size/tone and borderStyle for look and feel.
Installation
Import
Quick Start
Production Examples
Best Practices
- Non abusare dei Toast; per errori critici usa Notification o Modal.
