Appearance
Button
Điều khiển hành động chính. color = tông trạng thái (omit → primary Soft Periwinkle); variant = solid | outline | ghost | link | secondary.
ts
import { Button } from "@minap/ui";Sample
TSX
import { Button } from "@minap/ui";
export function Example() {
return (
<>
<div className="flex flex-wrap gap-2">
<Button>primary solid</Button>
<Button color="success">success</Button>
<Button color="warning">warning</Button>
<Button color="destructive">destructive</Button>
<Button color="info">info</Button>
<Button variant="secondary">secondary</Button>
<Button variant="outline">outline</Button>
<Button variant="ghost">ghost</Button>
<Button variant="link">link</Button>
<Button color="destructive" variant="outline">
destructive outline
</Button>
</div>
<div className="flex flex-wrap items-center gap-2">
<Button size="sm">sm</Button>
<Button size="default">default (~44px)</Button>
<Button size="lg">lg</Button>
<Button size="icon" aria-label="Icon">
★
</Button>
<Button disabled>disabled</Button>
</div>
</>
);
}
Props / API
| Prop / API | Type | Default | Notes |
|---|---|---|---|
color | "primary" | "success" | "warning" | "destructive" | "info" | "primary" | Omit → primary. Không có giá trị color="default". |
variant | "solid" | "outline" | "ghost" | "link" | "secondary" | "solid" | Chrome / giao diện (quy ước ngành) |
size | "default" | "sm" | "lg" | "icon" | "default" | size default dùng chiều cao touch ~44px |
asChild | boolean | false | Radix Slot |
className | string | — |
Behavior
- Focus ring khi tap + bàn phím
- touch-manipulation
- Forward thuộc tính button native
Related
- Category:
forms-inputs - Catalog gallery:
/catalog/forms-inputs