Skip to content
fandhe-frontend
GitHub

Radio Card

fandhe-frontend-pre-styled-uiradio_card mod が提供するスタイル済み Radio Card 部品です。

関連 API: fandhe-frontend-pre-styled-ui API

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-description

API Reference

Arguments

NameTypeDefaultDescription
sizeSizeSize::Mdサイズ variant。
paletteColorPaletteColorPalette::AccentcolorPalette 軸。
disabledboolfalseグループ全体の無効化状態。
orientationOption<Orientation>Noneキーボード操作方向のヒント(`aria-orientation`)。
labelled_byOption<&str>None`Some` のとき `aria-labelledby` を付与する。
attrsVec<(&str, &str)>root パーツへ合成する追加属性。
childrenVec<Node>root 配下の子ノード(通常 `item` 列)。

Data Attributes

PartAttributeObserved Values
itemdata-disabled
itemdata-statechecked, unchecked
itemdata-valueplan-enterprise-card, plan-free-card, plan-pro-card
item-controldata-disabled
item-controldata-statechecked, unchecked
item-hidden-inputdata-statechecked, unchecked
item-indicatordata-disabled
item-indicatordata-statechecked, unchecked
rootdata-orientationvertical

CSS Variables

VariableDefault
--fandhe-radio-card-control-size1rem
--fandhe-radio-card-dot-inset3px
--fandhe-radio-card-label-font-sizevar(--fandhe-font-font-size-sm)
--fandhe-radio-card-padding0.75rem