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

PropertyTypeDefaultDescription
checkedbooleanfalseWhether the checkbox is checked
indeterminatebooleanfalseWhether the checkbox is in indeterminate state
disabledbooleanfalseWhether the checkbox is disabled
valuestringundefinedValue when used in a form

Events

EventDescription
on:changeFired when the checkbox state changes