Appearance
Alert
Banner phản hồi inline. color = tông trạng thái (omit → primary).
ts
import { Alert, AlertTitle, AlertDescription } from "@minap/ui";Examples
Mẫu sống trong Preview; chọn View code khi cần copy.
Usage
tsx
import { Alert, AlertDescription, AlertTitle } from "@minap/ui";
export function Example() {
const tones = [
["primary", "Primary (omit color ≡ this)"],
["success", "Success"],
["warning", "Warning"],
["destructive", "Destructive (danger)"],
["info", "Info"],
] as const;
return (
<>
<div className="flex w-full flex-col gap-2">
<Alert>
<AlertTitle>Default (no color prop)</AlertTitle>
<AlertDescription>Resolves to primary Soft Periwinkle.</AlertDescription>
</Alert>
{tones.map(([color, title]) => (
<Alert key={color} color={color}>
<AlertTitle>{title}</AlertTitle>
<AlertDescription>status color tone.</AlertDescription>
</Alert>
))}
</div>
</>
);
}Props / API
| Prop / API | Type | Default | Notes |
|---|---|---|---|
color | "primary" | "success" | "warning" | "destructive" | "info" | "primary" | Omit → bề mặt soft Soft Periwinkle primary; destructive ≡ danger |
className | string | — |
Behavior
- AlertTitle
- AlertDescription