インポート
コードをコピー
import { CheckboxCard } from '@k8ordo/ui';使い方
縦書きプレビューに切り替え
Choose features to enable
コードをコピー
import { CheckboxCard } from '@k8ordo/ui';
import { useState } from 'react';
const options = [
{
value: 'history',
label: 'Version history',
description: 'Keep every change and roll back when needed.',
},
{
value: 'comments',
label: 'Inline comments',
description: 'Leave feedback directly on each section.',
},
{
value: 'share',
label: 'Share links',
description: 'Publish read-only share links in seconds.',
},
];
const [value, setValue] = useState(['comments']);
<p id="features-label">Choose features to enable</p>
<CheckboxCard
disabled={false}
invalid={false}
aria-labelledby="features-label"
onChange={setValue}
options={options}
value={value}
/>既定値
縦書きプレビューに切り替え
Choose features to enable
コードをコピー
const options = [
{
value: 'history',
label: 'Version history',
description: 'Keep every change and roll back when needed.',
},
{
value: 'comments',
label: 'Inline comments',
description: 'Leave feedback directly on each section.',
},
{
value: 'share',
label: 'Share links',
description: 'Publish read-only share links in seconds.',
},
];
<p id="features-default-label">Choose features to enable</p>
<CheckboxCard
defaultValue={['history', 'share']}
disabled={false}
invalid={false}
aria-labelledby="features-default-label"
options={options}
/>Props
aria-labelledby- Type:
string - Default: -
options- Type:
readonly CheckboxCardOption[] - Default: -
defaultValue?- Type:
string[] - Default: -
invalid?- Type:
boolean - Default:
false onChange?- Type:
(value: string[]) => void - Default: -
ref?- Type:
Ref<HTMLFieldSetElement> - Default: -
value?- Type:
string[] - Default: -
| Prop | Type | Default |
|---|---|---|
aria-labelledby | string | - |
options | readonly CheckboxCardOption[] | - |
defaultValue? | string[] | - |
invalid? | boolean | false |
onChange? | (value: string[]) => void | - |
ref? | Ref<HTMLFieldSetElement> | - |
value? | string[] | - |
継承する属性(内部で固定するものを除く): FieldsetHTMLAttributes<HTMLFieldSetElement>