diff --git a/docs/src/pages/components/Checkbox.svx b/docs/src/pages/components/Checkbox.svx index 70b163a9..36f6e5d4 100644 --- a/docs/src/pages/components/Checkbox.svx +++ b/docs/src/pages/components/Checkbox.svx @@ -23,9 +23,21 @@ -### Multiple +### Reactive example (bind:checked) -Bind a selection [group](https://svelte.dev/tutorial/group-inputs) to multiple checkboxes. +The `checked` prop supports two-way binding. + + + +### Reactive example (bind:group) + +An alternative to `checked` is binding an array of values using `group`. This API in inspired by Svelte [group inputs]([group](https://svelte.dev/tutorial/group-inputs)). + + +
+ If using bind:group, bind:checked will only support one-way binding. +
+
diff --git a/docs/src/pages/framed/Checkbox/CheckboxReactive.svelte b/docs/src/pages/framed/Checkbox/CheckboxReactive.svelte new file mode 100644 index 00000000..a58be9eb --- /dev/null +++ b/docs/src/pages/framed/Checkbox/CheckboxReactive.svelte @@ -0,0 +1,14 @@ + + + + +
+ +
+ +checked: +{checked}