Checkbox
The Checkbox component allows users to select one or more options from a set.
Import
<script>
import { Checkbox } from 'svelte-fluentui';
</script>
svelte
Basic Usage
<Checkbox>Accept terms and conditions</Checkbox>
svelte
Checked by Default
<Checkbox checked>Subscribe to newsletter</Checkbox>
svelte
Disabled State
<Checkbox disabled>Unavailable option</Checkbox>
svelte
Indeterminate State
<Checkbox indeterminate>Partially selected</Checkbox>
svelte
Properties
Property | Type | Default | Description |
---|---|---|---|
checked | boolean | false | Whether the checkbox is checked |
indeterminate | boolean | false | Whether the checkbox is in indeterminate state |
disabled | boolean | false | Whether the checkbox is disabled |
value | string | undefined | Value when used in a form |
Events
Event | Description |
---|---|
on:change | Fired when the checkbox state changes |