Checkbox

A control that allows the user to toggle between checked and not checked.

Loading preview…

Installation

Usage

Use checkbox for independent on/off choices. Bind checked or pass indeterminate for a partial state. Pair with a label via matching id and for attributes.

1<script lang="ts">
2	import { Checkbox } from '~/components/checkbox';
3</script>
4
5<div class="flex items-center gap-3">
6	<Checkbox id="terms" />
7	<label for="terms">Accept terms and conditions</label>
8</div>