BetaPublic beta — Read the release notes
Documentation

Checkbox

Binary or indeterminate toggle control.

Package
@solidiom/checkbox
Version
0.0.1-next.0
Status
stable

Preview

Toggle with Space to check or uncheck.

This preview uses documentation-only styling. Ship with one of the included recipe outputs (CSS, Tailwind, or UnoCSS) for production styles.

Binary or indeterminate toggle control.

Usage

Compose Group, Root, Indicator.

import * as Checkbox from "@solidiom/checkbox"

;<Checkbox.Group>Checkbox content</Checkbox.Group>

Installation

Install the package with pnpm add @solidiom/checkbox. The package requires compatible solid-js and @solidjs/web peer dependencies.

Parts

Checkbox exposes 3 parts:

  • Groupdata-part="group".
  • Rootdata-part="root".
  • Indicatordata-part="indicator".

Styling

Checkbox carries data-scope="checkbox" and data-part attributes on each part for CSS/recipe targeting. State attributes like data-state, data-disabled, and data-highlighted are exposed where applicable.

Keyboard & behavior

KeyBehavior
SpaceToggles the checkbox between checked and unchecked.

Composition

Checkbox is designed to compose with other primitives. Its parts can be combined with Field, Button, or other primitives as needed.

SSR and hydration

Checkbox renders as semantic HTML during server rendering. Interactive behavior (keyboard handlers, state management) activates on hydration without layout shift.