--- title: CheckboxCard description: "`CheckboxCard` is a component used for allowing users to select multiple values from multiple options." links: - source: https://github.com/yamada-ui/yamada-ui/tree/main/packages/react/src/components/checkbox-card - storybook: https://yamada-ui.github.io/yamada-ui?path=/story/components-checkboxcard--basic --- ```tsx ビアンカ パパスの息子より、ふたつ年上のしっかり者の幼なじみ。彼と一緒に、レヌール城のお化け退治に繰り出した。 フローラ 大富豪ルドマンの娘で、デボラの妹。ちょっぴり天然なところもある、清楚で可憐なお嬢様。 ルドマン なんと、この私が、好きと申すか!?そ、それはいかん!もう1度、考えてみなさい。 ``` ## Usage ```tsx import { CheckboxCard, CheckboxCardGroup } from "@yamada-ui/react" ``` ```tsx import { CheckboxCard, CheckboxCardGroup } from "@/components/ui" ``` ```tsx import { CheckboxCard, CheckboxCardGroup } from "@workspaces/ui" ``` ```tsx ``` ### Use Items ```tsx const items = useMemo( () => [ { description: "パパスの息子より、ふたつ年上のしっかり者の幼なじみ。彼と一緒に、レヌール城のお化け退治に繰り出した。", label: "ビアンカ", value: "1", }, { description: "大富豪ルドマンの娘で、デボラの妹。ちょっぴり天然なところもある、清楚で可憐なお嬢様。", label: "フローラ", value: "2", }, { description: "なんと、この私が、好きと申すか!?そ、それはいかん!もう1度、考えてみなさい。", label: "ルドマン", value: "3", }, ], [], ) return ``` ### Change Variant ```tsx const items = useMemo( () => [ { label: "Checked", value: "1" }, { label: "Unchecked", value: "2" }, ], [], ) return ( {(variant) => ( )} ) ``` ### Change Size ```tsx const items = useMemo( () => [ { label: "Checked", value: "1" }, { label: "Unchecked", value: "2" }, ], [], ) return ( {(size) => ( )} ) ``` ### Change Color Scheme ```tsx const items = useMemo( () => [ { label: "Checked", value: "1" }, { label: "Unchecked", value: "2" }, ], [], ) return ( {(colorScheme) => ( )} ) ``` ### Set Default Value To set a default value, set the value to `defaultValue`. ```tsx const items = useMemo( () => [ { description: "パパスの息子より、ふたつ年上のしっかり者の幼なじみ。彼と一緒に、レヌール城のお化け退治に繰り出した。", label: "ビアンカ", value: "1", }, { description: "大富豪ルドマンの娘で、デボラの妹。ちょっぴり天然なところもある、清楚で可憐なお嬢様。", label: "フローラ", value: "2", }, { description: "なんと、この私が、好きと申すか!?そ、それはいかん!もう1度、考えてみなさい。", label: "ルドマン", value: "3", }, ], [], ) return ``` ### Limit the Number of Selections To limit the number of selections, set a number to `max`. ```tsx const items = useMemo( () => [ { description: "パパスの息子より、ふたつ年上のしっかり者の幼なじみ。彼と一緒に、レヌール城のお化け退治に繰り出した。", label: "ビアンカ", value: "1", }, { description: "大富豪ルドマンの娘で、デボラの妹。ちょっぴり天然なところもある、清楚で可憐なお嬢様。", label: "フローラ", value: "2", }, { description: "なんと、この私が、好きと申すか!?そ、それはいかん!もう1度、考えてみなさい。", label: "ルドマン", value: "3", }, ], [], ) return ``` ### Change Orientation To change the orientation, set `orientation` to `"horizontal"` or `"vertical"`. By default, `"horizontal"` is set. ```tsx const items = useMemo( () => [ { description: "パパスの息子より、ふたつ年上のしっかり者の幼なじみ。彼と一緒に、レヌール城のお化け退治に繰り出した。", label: "ビアンカ", value: "1", }, { description: "大富豪ルドマンの娘で、デボラの妹。ちょっぴり天然なところもある、清楚で可憐なお嬢様。", label: "フローラ", value: "2", }, { description: "なんと、この私が、好きと申すか!?そ、それはいかん!もう1度、考えてみなさい。", label: "ルドマン", value: "3", }, ], [], ) return ``` ### Change Shape ```tsx const items = useMemo( () => [ { description: "パパスの息子より、ふたつ年上のしっかり者の幼なじみ。彼と一緒に、レヌール城のお化け退治に繰り出した。", label: "ビアンカ", value: "1", }, { description: "大富豪ルドマンの娘で、デボラの妹。ちょっぴり天然なところもある、清楚で可憐なお嬢様。", label: "フローラ", value: "2", }, { description: "なんと、この私が、好きと申すか!?そ、それはいかん!もう1度、考えてみなさい。", label: "ルドマン", value: "3", }, ], [], ) return ( {(shape) => ( )} ) ``` ### Change Alignment To change the alignment, set `justify` to `"start"` or `"end"`, etc. By default, `"start"` is set. ```tsx const items = useMemo( () => [ { description: "パパスの息子より、ふたつ年上のしっかり者の幼なじみ。彼と一緒に、レヌール城のお化け退治に繰り出した。", label: "ビアンカ", value: "1", }, { description: "大富豪ルドマンの娘で、デボラの妹。ちょっぴり天然なところもある、清楚で可憐なお嬢様。", label: "フローラ", value: "2", }, { description: "なんと、この私が、好きと申すか!?そ、それはいかん!もう1度、考えてみなさい。", label: "ルドマン", value: "3", }, ], [], ) return ( {(justify) => ( )} ) ``` ### Add Addon To add an addon, set `ReactNode` to `addon`. ```tsx const items = useMemo( () => [ { addon: "ドラゴンクエストV 天空の花嫁", description: "パパスの息子より、ふたつ年上のしっかり者の幼なじみ。彼と一緒に、レヌール城のお化け退治に繰り出した。", label: "ビアンカ", value: "1", }, { addon: "ドラゴンクエストV 天空の花嫁", description: "大富豪ルドマンの娘で、デボラの妹。ちょっぴり天然なところもある、清楚で可憐なお嬢様。", label: "フローラ", value: "2", }, { addon: "ドラゴンクエストV 天空の花嫁", description: "なんと、この私が、好きと申すか!?そ、それはいかん!もう1度、考えてみなさい。", label: "ルドマン", value: "3", }, ], [], ) return ``` ### Hide Indicator To hide the indicator, set `withIndicator` to `false`. ```tsx ウサギ カタツムリ リス ``` ### Disable To disable, set `disabled` to `true`. ```tsx const items = useMemo( () => [ { description: "パパスの息子より、ふたつ年上のしっかり者の幼なじみ。彼と一緒に、レヌール城のお化け退治に繰り出した。", label: "ビアンカ", value: "1", }, { description: "大富豪ルドマンの娘で、デボラの妹。ちょっぴり天然なところもある、清楚で可憐なお嬢様。", label: "フローラ", value: "2", }, { description: "なんと、この私が、好きと申すか!?そ、それはいかん!もう1度、考えてみなさい。", label: "ルドマン", value: "3", }, ], [], ) return ( {(variant) => ( )} ) ``` ### Read-Only To make read-only, set `readOnly` to `true`. ```tsx const items = useMemo( () => [ { description: "パパスの息子より、ふたつ年上のしっかり者の幼なじみ。彼と一緒に、レヌール城のお化け退治に繰り出した。", label: "ビアンカ", value: "1", }, { description: "大富豪ルドマンの娘で、デボラの妹。ちょっぴり天然なところもある、清楚で可憐なお嬢様。", label: "フローラ", value: "2", }, { description: "なんと、この私が、好きと申すか!?そ、それはいかん!もう1度、考えてみなさい。", label: "ルドマン", value: "3", }, ], [], ) return ( {(variant) => ( )} ) ``` ### Invalid To make the input invalid, set `invalid` to `true`. ```tsx const items = useMemo( () => [ { description: "パパスの息子より、ふたつ年上のしっかり者の幼なじみ。彼と一緒に、レヌール城のお化け退治に繰り出した。", label: "ビアンカ", value: "1", }, { description: "大富豪ルドマンの娘で、デボラの妹。ちょっぴり天然なところもある、清楚で可憐なお嬢様。", label: "フローラ", value: "2", }, { description: "なんと、この私が、好きと申すか!?そ、それはいかん!もう1度、考えてみなさい。", label: "ルドマン", value: "3", }, ], [], ) return ( {(variant) => ( )} ) ``` ### Customize Border Color To customize the border color, set a value to `focusBorderColor` or `errorBorderColor`. ```tsx const items = useMemo( () => [ { description: "パパスの息子より、ふたつ年上のしっかり者の幼なじみ。彼と一緒に、レヌール城のお化け退治に繰り出した。", label: "ビアンカ", value: "1", }, { description: "大富豪ルドマンの娘で、デボラの妹。ちょっぴり天然なところもある、清楚で可憐なお嬢様。", label: "フローラ", value: "2", }, { description: "なんと、この私が、好きと申すか!?そ、それはいかん!もう1度、考えてみなさい。", label: "ルドマン", value: "3", }, ], [], ) return ( ) ``` ### Customize Icon To customize the icon, set `ReactNode` to `checkedIcon`. ```tsx const items = useMemo( () => [ { description: "パパスの息子より、ふたつ年上のしっかり者の幼なじみ。彼と一緒に、レヌール城のお化け退治に繰り出した。", label: "ビアンカ", value: "1", }, { description: "大富豪ルドマンの娘で、デボラの妹。ちょっぴり天然なところもある、清楚で可憐なお嬢様。", label: "フローラ", value: "2", }, { description: "なんと、この私が、好きと申すか!?そ、それはいかん!もう1度、考えてみなさい。", label: "ルドマン", value: "3", }, ], [], ) return } items={items} /> ``` ### Control ```tsx const [value, setValue] = useState(["1"]) const items = useMemo( () => [ { description: "パパスの息子より、ふたつ年上のしっかり者の幼なじみ。彼と一緒に、レヌール城のお化け退治に繰り出した。", label: "ビアンカ", value: "1", }, { description: "大富豪ルドマンの娘で、デボラの妹。ちょっぴり天然なところもある、清楚で可憐なお嬢様。", label: "フローラ", value: "2", }, { description: "なんと、この私が、好きと申すか!?そ、それはいかん!もう1度、考えてみなさい。", label: "ルドマン", value: "3", }, ], [], ) return ( ) ``` ## Uses Components & Hooks ## Props ### CheckboxCard.Root | Prop | Default | Type | Description | | ------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | | `size` | `"md"` | `"lg" \| "md" \| "sm" \| "xl"` | The size of the component. | | `variant` | `"surface"` | `"outline" \| "subtle" \| "surface"` | The variant of the component. | | `addon` | - | `ReactNode` | The addon of the checkbox card. | | `addonProps` | - | `CheckboxCardAddonProps` | Props for the addon component. | | `checked` | - | `boolean` | If `true`, the checkbox will be checked. | | `checkedIcon` | - | `ReactNode` | The icon to display in the checkbox when it is checked. | | `defaultChecked` | `false` | `boolean` | If `true`, the checkbox will be initially checked. | | `description` | - | `ReactNode` | The description of the checkbox card. | | `descriptionProps` | - | `CheckboxCardDescriptionProps` | Props for the description component. | | `disabled` | `false` | `boolean` | If `true`, the field will be disabled. | | `errorBorderColor` | - | `"-moz-initial" \| "AccentColor" \| "AccentColorText" \| "ActiveBorder" \| "ActiveCaption" \| "ActiveText" \| "aliceblue" \| "amber.100" \| "amber.200" \| "amber.300" ...` | The border color when the input is invalid. | | `focusBorderColor` | - | `"-moz-initial" \| "AccentColor" \| "AccentColorText" \| "ActiveBorder" \| "ActiveCaption" \| "ActiveText" \| "aliceblue" \| "amber.100" \| "amber.200" \| "amber.300" ...` | The border color when the input is focused. | | `id` | - | `string` | id assigned to input. | | `indeterminate` | `false` | `boolean` | If `true`, the checkbox will be indeterminate. | | `indeterminateIcon` | - | `ReactNode` | The icon to display in the checkbox when it is indeterminate. | | `indicatorProps` | - | `CheckboxCardIndicatorProps` | Props for the indicator component. | | `inputProps` | - | `HTMLStyledProps<"input">` | Props for the input element. | | `invalid` | `false` | `boolean` | If `true`, the field will be invalid. | | `label` | - | `ReactNode` | The label of the checkbox card. | | `labelProps` | - | `CheckboxCardLabelProps` | Props for the label component. | | `name` | - | `string` | The name of the input field in a checkbox. | | `onBlur` | - | `FocusEventHandler` | The callback invoked when the checkbox is blurred. | | `onChange` | - | `ChangeEventHandler` | The callback invoked when the checked state changes. | | `onFocus` | - | `FocusEventHandler` | The callback invoked when the checkbox is focused. | | `readOnly` | `false` | `boolean` | If `true`, the field will be readonly. | | `required` | `false` | `boolean` | If `true`, the field will be required. | | `rootProps` | - | `HTMLStyledProps<"label">` | Props for the label element. | | `value` | - | `Y` | The value of the checkbox. | | `withIndicator` | `true` | `boolean` | If `true`, the indicator will be displayed. | ### CheckboxCard.Addon | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | ### CheckboxCard.Description | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | ### CheckboxCard.Label | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | ### CheckboxCardGroup.Root | Prop | Default | Type | Description | | ------------------ | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | | `size` | `"md"` | `"lg" \| "md" \| "sm" \| "xl"` | The size of the component. | | `variant` | `"surface"` | `"outline" \| "subtle" \| "surface"` | The variant of the component. | | `align` | - | `"-moz-initial" \| "anchor-center" \| "baseline" \| "center" \| "end" \| "flex-end" \| "flex-start" \| "inherit" \| "initial" \| "normal" ...` | The CSS `align-items` property. | | `basis` | - | `"-moz-fit-content" \| "-moz-initial" \| "-moz-max-content" \| "-moz-min-content" \| "-webkit-auto" \| "0.5" \| "1.5" \| "1" \| "1/12" \| "1/2" ...` | The CSS `flex-basis` property. | | `checkedIcon` | - | `string \| number \| bigint \| boolean \| ReactElement> \| Iterable \| ReactPortal \| Promise<...>` | The icon to display in the checkbox when it is checked. | | `defaultValue` | `[]` | `Y[]` | The initial value of the checkbox group. | | `direction` | - | `"-moz-initial" \| "column-reverse" \| "column" \| "inherit" \| "initial" \| "revert-layer" \| "revert" \| "row-reverse" \| "row" \| "unset" ...` | The CSS `flex-direction` property. | | `disabled` | `false` | `boolean` | If `true`, the field will be disabled. | | `errorBorderColor` | - | `"-moz-initial" \| "AccentColor" \| "AccentColorText" \| "ActiveBorder" \| "ActiveCaption" \| "ActiveText" \| "aliceblue" \| "amber.100" \| "amber.200" \| "amber.300" ...` | The border color when the input is invalid. | | `focusBorderColor` | - | `"-moz-initial" \| "AccentColor" \| "AccentColorText" \| "ActiveBorder" \| "ActiveCaption" \| "ActiveText" \| "aliceblue" \| "amber.100" \| "amber.200" \| "amber.300" ...` | The border color when the input is focused. | | `invalid` | `false` | `boolean` | If `true`, the field will be invalid. | | `items` | `[]` | `CheckboxCardGroupItem[]` | If provided, generate options based on items. | | `max` | - | `number` | The maximum number of checkboxes that can be checked. | | `onChange` | - | `(value: Y[]) => void` | The callback fired when any children checkbox is checked or unchecked. | | `readOnly` | `false` | `boolean` | If `true`, the field will be readonly. | | `required` | `false` | `boolean` | If `true`, the field will be required. | | `shrink` | - | `"-moz-initial" \| "inherit" \| "initial" \| "revert-layer" \| "revert" \| "unset" \| number & {} ...` | The CSS `flex-shrink` property. | | `value` | - | `Y[]` | The value of the checkbox group. | | `withIndicator` | `true` | `boolean` | If `true`, the indicator will be displayed. | | `wrap` | - | `"-moz-initial" \| "inherit" \| "initial" \| "nowrap" \| "revert-layer" \| "revert" \| "unset" \| "wrap-reverse" \| "wrap" ...` | The CSS `flex-wrap` property. | ### CheckboxCardGroup.Item.Root | Prop | Default | Type | Description | | ------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | | `size` | `"md"` | `"lg" \| "md" \| "sm" \| "xl"` | The size of the component. | | `variant` | `"surface"` | `"outline" \| "subtle" \| "surface"` | The variant of the component. | | `addon` | - | `ReactNode` | The addon of the checkbox card. | | `addonProps` | - | `CheckboxCardAddonProps` | Props for the addon component. | | `checked` | - | `boolean` | If `true`, the checkbox will be checked. | | `checkedIcon` | - | `ReactNode` | The icon to display in the checkbox when it is checked. | | `defaultChecked` | `false` | `boolean` | If `true`, the checkbox will be initially checked. | | `description` | - | `ReactNode` | The description of the checkbox card. | | `descriptionProps` | - | `CheckboxCardDescriptionProps` | Props for the description component. | | `disabled` | `false` | `boolean` | If `true`, the field will be disabled. | | `errorBorderColor` | - | `"-moz-initial" \| "AccentColor" \| "AccentColorText" \| "ActiveBorder" \| "ActiveCaption" \| "ActiveText" \| "aliceblue" \| "amber.100" \| "amber.200" \| "amber.300" ...` | The border color when the input is invalid. | | `focusBorderColor` | - | `"-moz-initial" \| "AccentColor" \| "AccentColorText" \| "ActiveBorder" \| "ActiveCaption" \| "ActiveText" \| "aliceblue" \| "amber.100" \| "amber.200" \| "amber.300" ...` | The border color when the input is focused. | | `id` | - | `string` | id assigned to input. | | `indeterminate` | `false` | `boolean` | If `true`, the checkbox will be indeterminate. | | `indeterminateIcon` | - | `ReactNode` | The icon to display in the checkbox when it is indeterminate. | | `indicatorProps` | - | `CheckboxCardIndicatorProps` | Props for the indicator component. | | `inputProps` | - | `HTMLStyledProps<"input">` | Props for the input element. | | `invalid` | `false` | `boolean` | If `true`, the field will be invalid. | | `label` | - | `ReactNode` | The label of the checkbox card. | | `labelProps` | - | `CheckboxCardLabelProps` | Props for the label component. | | `name` | - | `string` | The name of the input field in a checkbox. | | `onBlur` | - | `FocusEventHandler` | The callback invoked when the checkbox is blurred. | | `onChange` | - | `ChangeEventHandler` | The callback invoked when the checked state changes. | | `onFocus` | - | `FocusEventHandler` | The callback invoked when the checkbox is focused. | | `readOnly` | `false` | `boolean` | If `true`, the field will be readonly. | | `required` | `false` | `boolean` | If `true`, the field will be required. | | `rootProps` | - | `HTMLStyledProps<"label">` | Props for the label element. | | `value` | - | `Y` | The value of the checkbox. | | `withIndicator` | `true` | `boolean` | If `true`, the indicator will be displayed. | ### CheckboxCardGroup.Item.Addon | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | ### CheckboxCardGroup.Item.Description | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | ### CheckboxCardGroup.Item.Label | Prop | Default | Type | Description | | ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ | | `as` | - | `As` | The HTML element to render. | | `asChild` | - | `boolean` | Merges its props onto its immediate child. | | `css` | - | `CSSObject \| CSSObject[]` | The CSS object. | | `colorScheme` | - | `"amber" \| "black" \| "blackAlpha" \| "blue" \| "cyan" \| "danger" \| "emerald" \| "error" \| "flashy" \| "fuchsia" ...` | Set color scheme variables. | ## Accessibility The `CheckboxCard` follows the [WAI-ARIA - Checkbox Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/checkbox) for accessibility. If you are not using `Field.Root`, set `aria-label` or `aria-labelledby` to `CheckboxCardGroup.Root`. ```tsx const items = useMemo( () => [ { label: "ビアンカ", value: "1" }, { label: "フローラ", value: "2" }, { label: "ルドマン", value: "3" }, ], [], ) return ``` ```tsx const items = useMemo( () => [ { label: "ビアンカ", value: "1" }, { label: "フローラ", value: "2" }, { label: "ルドマン", value: "3" }, ], [], ) return ( キャラクター ) ``` ### Keyboard Navigation | Key | Description | State | | ------- | ------------------------------------------ | ----- | | `Space` | Toggles the checked state of the checkbox. | - | ### ARIA Roles and Attributes | Component | Roles and Attributes | Usage | | ------------------------ | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `CheckboxCardGroup.Root` | `role="group"` | Indicates that it's a group. | | | `aria-labelledby` | If `CheckboxCardGroup.Root` is within a `Field.Root` and `Field.Root` has a `label` or `Field.Label`, sets its `id`. | | | `aria-describedby` | If `CheckboxCardGroup.Root` is within a `Field.Root` and `Field.Root` has an `errorMessage`, `helperMessage`, or a `Field.ErrorMessage`, `Field.HelperMessage`, sets its `id`. | | `input` | `aria-checked` | Sets to `"mixed"` if `indeterminate` is set, `"true"` if checked, and `"false"` if unchecked. | | | `aria-disabled` | Sets to `"true"` if `readOnly` is set, or if `max` is reached in a group. | | | `aria-invalid` | Sets to `"true"` if `invalid` is set. | | | `aria-required` | Sets to `"true"` if `required` is set. | | `CheckboxCardIndicator` | `aria-hidden` | Excludes the element from the accessibility tree. |