- Components
- Feedback
- Alert
Alert
Displays a callout for user attention.
default.tsx
Installation
CLI
Manual
npm
pnpm
yarn
bun
Examples
Variants
Use the variant
and fill
props to change the visual style of the alert.
Variant
variants.tsx
Title
Use the title
prop to add a title to the alert.
Your account has been suspended.
title.tsx
Content
Pass children to the alert to add content.
Payment Information
content.tsx
Custom icon
Use the icon
prop to add a custom icon to the alert. An explicit null
value can be used to remove the default icon.
custom-icon.tsx
Action
Use the action
prop to add an action to the alert.
action.tsx
Examples
Composition
If you need to customize things further, you can drop down the composition pattern.
Payment Information
composition.tsx
API Reference
Alert accepts all HTML div
element props and the following:
Prop | Type | Default | Description |
---|---|---|---|
variant | 'default' | 'success | 'warning' | 'danger | 'info' | 'default' | The visual style of the alert. |
fill | boolean | false | Weather the visual style should be filled. |