Skip to content
fandhe-frontendcore v0.4.3
GitHub

Checkbox Card

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

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

Demo

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

Size

Features

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

Anatomy

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

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-invalid(値なし)
contentdata-statechecked, unchecked
controldata-disabled(値なし)
controldata-invalid(値なし)
controldata-statechecked, unchecked
descriptiondata-disabled(値なし)
descriptiondata-invalid(値なし)
descriptiondata-statechecked, unchecked
hidden-inputdata-disabled(値なし)
hidden-inputdata-invalid(値なし)
hidden-inputdata-statechecked, unchecked
indicatordata-disabled(値なし)
indicatordata-invalid(値なし)
indicatordata-statechecked, unchecked
indicator-checkdata-disabled(値なし)
indicator-checkdata-invalid(値なし)
indicator-checkdata-statechecked, unchecked
labeldata-disabled(値なし)
labeldata-invalid(値なし)
labeldata-statechecked, unchecked
rootdata-disabled(値なし)
rootdata-invalid(値なし)
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-description-font-sizevar(--fandhe-font-font-size-sm)
--fandhe-checkbox-card-gapvar(--fandhe-space-2)
--fandhe-checkbox-card-label-font-sizevar(--fandhe-font-font-size-sm)
--fandhe-checkbox-card-padding0.75rem