Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 918 Bytes

CHECKBOX-GROUP.md

File metadata and controls

25 lines (18 loc) · 918 Bytes

Checkbox Group

import { CheckboxGroup } from "@mpiorowski/svelte-init";

Usage

<CheckboxGroup bind:group={checkboxGroupValues} values={ [ { value: 'value1', label: 'Label1' }, { value: 'value2', label: 'Label2' } ]} />
<CheckboxGroup bind:group={radioGroupValues} values={ [ { value: 'value1', label: 'Label1' }, { value: 'value2', label: 'Label2' } ]} type='radio' />
Prop Values Default
group string, string[]
values { value: string; label: string; }[]
type checkbox, radio checkbox

If type is set to checkbox then bind:group should be string[]. If type is set to radio then bind:group should be string.