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
Size
Features
size/colorPalettevariant クラスをrootへ付与し、role="radiogroup"を固定付与する。item/item_control/item_content/item_text/item_description/item_addon/item_indicator/item_hidden_inputの各パーツでカード形状の選択肢を構成する。- 選択中の
itemは palette-subtle 背景(--fandhe-palette-subtle)+ palette 枠線で強調される(イシュー #2213)。
Anatomy
root
label
item
item-hidden-input
item-control
item-content
item-text
item-description
item-indicatorAPI 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-invalid | (値なし) |
item | data-state | checked, unchecked |
item | data-value | plan-enterprise-card, plan-free-card, plan-invalid-card, plan-pro-card, showcase-radio-card-size-lg, showcase-radio-card-size-md, showcase-radio-card-size-sm, showcase-radio-card-size-xl, showcase-radio-card-size-xs |
item-control | data-disabled | (値なし) |
item-control | data-state | checked, unchecked |
item-hidden-input | data-state | checked, unchecked |
item-indicator | data-disabled | (値なし) |
item-indicator | data-invalid | (値なし) |
item-indicator | data-state | checked, unchecked |
root | data-orientation | vertical |
CSS Variables
| Variable | Default |
|---|---|
--fandhe-radio-card-control-size | 1rem |
--fandhe-radio-card-description-font-size | var(--fandhe-font-font-size-sm) |
--fandhe-radio-card-dot-inset | 3px |
--fandhe-radio-card-gap | var(--fandhe-space-2) |
--fandhe-radio-card-label-font-size | var(--fandhe-font-font-size-sm) |
--fandhe-radio-card-padding | 0.75rem |