Choose features to enable
aria-labelledbystringoptionsreadonly CheckboxCardOption[]defaultValue?neverinvalid?booleanfalseonChange?(value: string[]) => voidref?Ref<HTMLFieldSetElement>value?string[]| Prop | Type | Default |
|---|---|---|
aria-labelledby | string | - |
options | readonly CheckboxCardOption[] | - |
defaultValue? | never | - |
invalid? | boolean | false |
onChange? | (value: string[]) => void | - |
ref? | Ref<HTMLFieldSetElement> | - |
value? | string[] | - |
Choose features to enable
import { CheckboxCard } from '@k8ordo/ui';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}
/>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}
/>