Skip to content
fandhe-frontend
GitHub

Checkbox Card

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

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

Demo

chakra-ui checkbox-card 相当のカード型選択 UI。状態機械は Checkbox(headless)をそのまま再利用し、data-scope="checkbox-card" の新規 anatomy でカード外観を重ねます。

Features

  • `checkbox::CheckboxProps` を共有し、カード形状のコンテナ(`control`/`content`/`label`/`description`/`addon`/`indicator` の各パーツ)へ配置する複合部品。
  • `size`/`colorPalette` variant クラスを `root` へ付与する。
  • `indicator_check` パーツでチェック済み時のみ描画されるチェックマークを提供する。

Anatomy

root
  hidden-input
  control
    indicator
      indicator-check
    content
      label
      description

API Reference

Arguments

NameTypeDefaultDescription
sizeSizeSize::Mdサイズ variant。
paletteColorPaletteColorPalette::AccentcolorPalette 軸。
props&CheckboxProps`checkbox` モジュールと共有の状態構造体。
attrsVec<(&str, &str)>root(`<label>`)パーツへ合成する追加属性。
childrenVec<Node>root 配下の子ノード(通常 control/content を含む)。

Data Attributes

PartAttributeObserved Values
contentdata-disabled
contentdata-statechecked, unchecked
controldata-disabled
controldata-statechecked, unchecked
descriptiondata-disabled
descriptiondata-statechecked, unchecked
hidden-inputdata-disabled
hidden-inputdata-statechecked, unchecked
indicatordata-disabled
indicatordata-statechecked, unchecked
indicator-checkdata-disabled
indicator-checkdata-statechecked, unchecked
labeldata-disabled
labeldata-statechecked, unchecked
rootdata-disabled
rootdata-statechecked, unchecked

CSS Variables

VariableDefault
--fandhe-checkbox-card-check-height0.5rem
--fandhe-checkbox-card-check-width0.25rem
--fandhe-checkbox-card-control-size1rem
--fandhe-checkbox-card-dash-width0.5rem
--fandhe-checkbox-card-label-font-sizevar(--fandhe-font-font-size-sm)
--fandhe-checkbox-card-padding0.75rem