Radio Card
fandhe-frontend-pre-styled-ui の radio_card mod が提供するスタイル済み Radio Card 部品です。
Demo
chakra-ui radio-card 相当のカード型選択 UI。状態機械は RadioGroup(headless)をそのまま再利用し、data-scope="radio-card" の新規 anatomy でカード外観を重ねます。
Plan
Features
- `size`/`colorPalette` variant クラスを `root` へ付与し、`role="radiogroup"` を固定付与する。
- `item`/`item_control`/`item_content`/`item_text`/`item_description`/`item_addon`/`item_indicator`/`item_hidden_input` の各パーツでカード形状の選択肢を構成する。
Anatomy
root
label
item
item-hidden-input
item-control
item-indicator
item-content
item-text
item-descriptionAPI Reference
Arguments
| Name | Type | Default | Description |
|---|---|---|---|
| size | Size | Size::Md | サイズ variant。 |
| palette | ColorPalette | ColorPalette::Accent | colorPalette 軸。 |
| disabled | bool | false | グループ全体の無効化状態。 |
| orientation | Option<Orientation> | None | キーボード操作方向のヒント(`aria-orientation`)。 |
| labelled_by | Option<&str> | None | `Some` のとき `aria-labelledby` を付与する。 |
| attrs | Vec<(&str, &str)> | root パーツへ合成する追加属性。 | |
| children | Vec<Node> | root 配下の子ノード(通常 `item` 列)。 |
Data Attributes
| Part | Attribute | Observed Values |
|---|---|---|
| item | data-disabled | |
| item | data-state | checked, unchecked |
| item | data-value | plan-enterprise-card, plan-free-card, plan-pro-card |
| item-control | data-disabled | |
| item-control | data-state | checked, unchecked |
| item-hidden-input | data-state | checked, unchecked |
| item-indicator | data-disabled | |
| item-indicator | data-state | checked, unchecked |
| root | data-orientation | vertical |
CSS Variables
| Variable | Default |
|---|---|
| --fandhe-radio-card-control-size | 1rem |
| --fandhe-radio-card-dot-inset | 3px |
| --fandhe-radio-card-label-font-size | var(--fandhe-font-font-size-sm) |
| --fandhe-radio-card-padding | 0.75rem |