Alerts
Alert component with info, success, error, warning and dark colors, outlined and accent variants, icons, lists, actions and a dismiss button.
How to use it
Run npx @blossomui/react add alert, or copy src/components/UI/Alerts/Alert.tsx into your React project and import it.
import { Alert, AlertAction } from './components/ui/Alert'Props
AlertProps
| Prop | Type | Description |
|---|---|---|
| dismissLabel | string | Accessible name of the dismiss button. |
| color | AlertColor | (string & {}) | A preset, `accent` for the brand color or any CSS color, for example `#7c3aed`. A custom color is used for the border, the icon and a soft tint of the background. |
| variant | 'filled' | 'outlined' | 'accent' | `accent` adds a thick border on the left side. |
| showIcon | boolean | Show an icon that matches the color. |
| list | string[] | Items rendered as a list below the message. |
| actions | ReactNode | Buttons or links rendered below the message. |
| dismissible | boolean | Adds a close button; the alert hides itself when it is pressed. |
| onDismiss | () => void | |
| children (required) | ReactNode |