Checkbox

A binary toggle input for selecting one or multiple options.

Installation

Install the component package, shared coss-svelte theme, and Bits UI peer.

npm install coss-svelte @coss-svelte/theme bits-ui

Usage

Import the Svelte component exports directly from the package.

import { Checkbox } from "coss-svelte";

Anatomy

Checkbox exposes a single component export for the current implementation.

API Reference

Checkbox

A binary toggle input for selecting one or multiple options.

PropTypeDefaultDescription
idstring-ID forwarded to the form control.
bind:checkedbooleanfalseChecked state for the control. Bind with `bind:checked` when supported.
bind:indeterminatebooleanfalseDisplays the checkbox in an indeterminate state.
labelstring""Accessible label or fallback visible label for the control.
bind:ref : HTMLElement | null

Inherits from Bits UI Checkbox.Root.

Implementation Details

Status
Stable
Foundation
bits
Category
Toggle & Choice
Particles
5