FormRadioGroupField
RadioGroupField
ラジオグループフィールドコンポーネント
概要
排他選択のラジオボタングループ。<fieldset> で描画され、選択肢が縦に並ぶ。
Props
| Prop | 型 | 必須 | 説明 |
|---|---|---|---|
label | string | Yes | フィールドラベル(legend) |
options | { label: string; value: string }[] | Yes | 選択肢 |
description | string | — | ヘルパーテキスト |
error | string | — | エラーメッセージ |
value | string | — | 制御値 |
defaultValue | string | — | 初期値 |
onValueChange | (value: string) => void | — | 変更コールバック |
disabled | boolean | — | 無効化 |
使用例
import { RadioGroupField } from "@unitto/ui";
<RadioGroupField
label="プラン"
options={[
{ label: "フリー", value: "free" },
{ label: "スタンダード", value: "standard" },
{ label: "プレミアム", value: "premium" },
]}
defaultValue="free"
onValueChange={(value) => console.log(value)}
/>