Components
Banner
A banner component for displaying important information, alerts, or notifications.
Demo
Code
Information
This is an informational message.
Success
Your changes have been saved.
Warning
Please review your information carefully.
Error
Something went wrong. Please try again.
Installation
Usage
Basic Usage
Variants
Dismissible
Allow users to dismiss the banner:
Custom Icon
Replace the default icon:
Without Icon
Hide the icon entirely:
With Custom Content
Add any content to the banner:
API Reference
Banner
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'default' | 'info' | 'success' | 'warning' | 'destructive' | 'default' | Visual variant |
title | string | — | Banner title |
description | string | — | Banner description |
children | ReactNode | — | Custom content |
icon | ReactNode | — | Custom icon |
showIcon | boolean | true | Show/hide icon |
dismissible | boolean | false | Allow dismissal |
onDismiss | () => void | — | Callback when dismissed |
className | string | — | Additional classes |