Appearance
RadioGroup
Nhóm chọn một.
ts
import { RadioGroup, RadioGroupItem } from "@minap/ui";Examples
Mẫu sống trong Preview; chọn View code khi cần copy.
Usage
tsx
import { Label, RadioGroup, RadioGroupItem } from "@minap/ui";
export function Example() {
return (
<>
<RadioGroup defaultValue="a" className="gap-3">
<Label className="flex min-h-touch items-center gap-2">
<RadioGroupItem value="a" id="ra" /> Option A
</Label>
<Label className="flex min-h-touch items-center gap-2">
<RadioGroupItem value="b" id="rb" /> Option B
</Label>
</RadioGroup>
</>
);
}Props / API
| Prop / API | Type | Default | Notes |
|---|---|---|---|
value / defaultValue | string | — | |
onValueChange | (value: string) => void | — | |
disabled | boolean | false | |
RadioGroupItem.value | string | — | Bắt buộc cho mỗi item |
Behavior
- size-5 items
- focus ring