Alert
Alert displays informational banners with icons and customizable styling.
Featuresβ
- π¨ Multiple variants
- π Size options
- πΌοΈ Left/right icons
- π― Customizable content
Basic Usageβ
import { Alert } from '@tansuk/rott-ui';
<Alert
text="This is an alert message"
variant="info"
/>
Variantsβ
<Alert text="Info message" variant="info" />
<Alert text="Success message" variant="success" />
<Alert text="Warning message" variant="warning" />
<Alert text="Error message" variant="danger" />
With Iconsβ
<Alert
text="Important message"
variant="warning"
leftIcon={{ name: 'WARNING', width: 20, height: 20 }}
/>
<Alert
text="Completed"
variant="success"
leftIcon={{ name: 'CHECK_CIRCLE', width: 20, height: 20 }}
rightIcon={{ name: 'CLOSE', width: 16, height: 16 }}
/>
Sizesβ
<Alert text="Small alert" size="sm" />
<Alert text="Medium alert" size="md" />
<Alert text="Large alert" size="lg" />
Propsβ
| Prop | Type | Default | Description |
|---|---|---|---|
text | string | LabelProps | - | Alert message |
variant | Variant | 'info' | Color variant |
size | Size | 'md' | Alert size |
leftIcon | IconProps | - | Left icon |
rightIcon | IconProps | - | Right icon |
Examplesβ
Info Alertβ
<Alert
text="Your session will expire in 5 minutes"
variant="info"
leftIcon={{ name: 'INFORMATION_CIRCLE', width: 20, height: 20 }}
/>
Success Alertβ
<Alert
text="Your changes have been saved"
variant="success"
leftIcon={{ name: 'CHECK_CIRCLE', width: 20, height: 20 }}
/>
Warning Alertβ
<Alert
text="Please verify your email address"
variant="warning"
leftIcon={{ name: 'WARNING', width: 20, height: 20 }}
/>
Error Alertβ
<Alert
text="Failed to load data. Please try again."
variant="danger"
leftIcon={{ name: 'WARNING_ERROR', width: 20, height: 20 }}
/>