docs: Checkbox, Tabs, NumberInput (#1045)

* 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
This commit is contained in:
metonym 2022-01-27 07:27:10 -08:00 committed by GitHub
commit 4e3415a4e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 65 additions and 27 deletions

View file

@ -0,0 +1,15 @@
<script>
import { NumberInput, Button } from "carbon-components-svelte";
let value = null;
</script>
<NumberInput allowEmpty bind:value />
<div style="margin: var(--cds-layout-01) 0">
<Button on:click="{() => (value = null)}">Set to null</Button>
<Button on:click="{() => (value = 0)}">Set to 0</Button>
</div>
<strong>Value:</strong>
{value}