mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-16 02:41:05 +00:00
* add `Checkbox` reactive example for `bind:checked` (#967) * update `Checkbox` reactive example for `bind:group` to demo two-way binding * simplify `Tabs` reactive example * add `NumberInput` "No value" example
14 lines
312 B
Svelte
14 lines
312 B
Svelte
<script>
|
|
import { Checkbox, Button } from "carbon-components-svelte";
|
|
|
|
let checked = false;
|
|
</script>
|
|
|
|
<Checkbox labelText="Label text" bind:checked />
|
|
|
|
<div style="margin: var(--cds-layout-01) 0">
|
|
<Button on:click="{() => (checked = !checked)}">Toggle</Button>
|
|
</div>
|
|
|
|
<strong>checked:</strong>
|
|
{checked}
|