コンポーネント
Radio Group
一度に1つしか選択できない、ラジオボタンと呼ばれるチェック可能なボタンの集合です。
Default
Comfortable
Compact
使い方
import { Label, RadioGroup, RadioGroupItem } from "@murasakijs/ui";<RadioGroup defaultValue="comfortable">
<div className="flex items-center gap-2">
<RadioGroupItem value="comfortable" id="r1" />
<Label htmlFor="r1">Comfortable</Label>
</div>
</RadioGroup>API リファレンス
RadioGroup
| Prop | 型 | デフォルト |
|---|---|---|
value | string | — |
defaultValue | string | — |
onValueChange | (value: string) => void | — |
disabled | boolean | false |
name | string | — |
required | boolean | false |
RadioGroupItem
| Prop | 型 | デフォルト |
|---|---|---|
value | string | — (必須) |
disabled | boolean | false |
どちらも React Aria のラジオグループ状態、キーボード操作、ラベル付けを利用しながら、value / onValueChange API を維持します。