Skip to main content
  1. Docs
  2. Components
  3. Forms

Checkbox

Yes or no, or several of a list. It waits for the form's Save; the whole row is the target.

Import
@qeetrix/react
Status
StableSince 0.0.2
Renders
<span role="checkbox">Server-rendered
Tested
WCAG 2.2 AAaxe on every pull request

01

Import

checkbox.tsx
// From the package: a build keeps only what it uses.
import { Checkbox, CheckboxGroup } from "@qeetrix/react";

// Or from its own path.
import { Checkbox, CheckboxGroup } from "@qeetrix/react/checkbox";

02

Props

And every native attribute of the element it renders.

PropTypeDefaultWhat it does
labelReactNode—The row's label; without one, aria-label is required by its type.
descriptionReactNode—A line under the label.
iconIconSource—An icon before the label; on a tile, in its box.
checked · defaultChecked · onCheckedChangeboolean—Controlled, or to start with.
indeterminatebooleanfalseMixed: a dash.
parentbooleanfalseIn a group with allValues: checks them all; a dash while some are.
value · name · disabled · required…—Its value in a group; as on a form control.

03

Parts

Each part carries a data-slot, for tests and placement.

data-slotElementWhat it is
checkbox<div>The row.
checkbox-indicator<span role="checkbox">The box: ref and Base UI props land here.
checkbox-mark<span>The tick or the dash.

04

CheckboxGroup

label is its legend; value is the array of checked values; variant="tile" and columns for tiles.

events.tsx
<CheckboxGroup label="Tell me about" name="events" value={events} onValueChange={setEvents} error={errors.events}>
  <Checkbox value="sign-ins" label="New sign-ins" />
  <Checkbox value="invites" label="Accepted invites" />
</CheckboxGroup>
Next — CheckboxAccessibility