Checkbox Group
Basic usage
Checked values:
Apple
Banana
Orange
Peach
<script lang="ts">
let checkedValues: any = []
const options = [
{ label: 'Apple', value: 1 },
{ label: 'Banana', value: 2 },
{ label: 'Orange', value: 3 },
{ label: 'Peach', value: 4 },
]
</script>
<div text-xl>
<b>Checked values:</b>
{checkedValues}
</div>
<CCheckboxGroup {options} bind:value={checkedValues} />
<script lang="ts">
let checkedValues: any = []
const options = [
{ label: 'Apple', value: 1 },
{ label: 'Banana', value: 2 },
{ label: 'Orange', value: 3 },
{ label: 'Peach', value: 4 },
]
</script>
<div text-xl>
<b>Checked values:</b>
{checkedValues}
</div>
<CCheckboxGroup {options} bind:value={checkedValues} />
svelte
Click fold/expand code
CCheckboxGroup Props
- valuedefault:
any[]
undefined
Checkbox group current value. It is recommended to use
bind:value
. - optionsdefault:
Array<{ label: string; value: any; [k: string]: any }>
undefined
The options array.
- sizedefault:
'xs' | 'sm' | 'md' | 'lg' | 'xl'=
undefined
The size of every item.
- gutterSizedefault:
'xs' | 'sm' | 'md' | 'lg' | 'xl'=
undefined
The size of every item.
CCheckboxGroup Events
No data
CCheckboxGroup Slots
No data
CCheckboxGroup Exports
No data