Alert
An inline alert message for displaying important information, warnings, success states, or error messages to the user.
Preview
Default
Check-in Reminder
Your check-in at Zostel Manali is tomorrow at 2:00 PM. Don't forget your ID proof!
Destructive
Booking Failed
Your payment could not be processed. Please try again or use a different payment method.
Usage
tsx
import {
Alert,
AlertTitle,
AlertDescription,
} from "zostel-ui";
{/* Default / Info */}
<Alert>
<InfoIcon className="h-4 w-4" />
<AlertTitle>New Feature Available</AlertTitle>
<AlertDescription>
You can now save your favourite hostels.
</AlertDescription>
</Alert>
{/* Warning */}
<Alert variant="warning">
<AlertTriangleIcon className="h-4 w-4" />
<AlertTitle>Limited Availability</AlertTitle>
<AlertDescription>
Only 2 beds remaining for your selected dates.
</AlertDescription>
</Alert>
{/* Destructive */}
<Alert variant="destructive">
<XCircleIcon className="h-4 w-4" />
<AlertTitle>Payment Failed</AlertTitle>
<AlertDescription>
Your payment could not be processed.
</AlertDescription>
</Alert>Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "default" | "success" | "warning" | "destructive" | "default" | The visual style variant of the alert |
className | string | — | Additional CSS classes to apply to the alert |
children | ReactNode | — | The content of the alert, typically AlertTitle and AlertDescription |
variantType:
"default" | "success" | "warning" | "destructive"Default: "default"
The visual style variant of the alert
classNameType:
stringDefault: —
Additional CSS classes to apply to the alert
childrenType:
ReactNodeDefault: —
The content of the alert, typically AlertTitle and AlertDescription