- Docs
- Components
- 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
Playground
Every prop, live, and the code it takes.
Every Monday at 9 am.
import { Checkbox } from "@qeetrix/react";
<Checkbox
label="Email me a weekly summary"
description="Every Monday at 9 am."
defaultChecked
/>02
On its own
Yes or no: the whole row is the target, the description says what it means.
Every Monday at 9 am.
<Stack gap="md">
<Checkbox label="Email me a weekly summary" description="Every Monday at 9 am." defaultChecked />
<Checkbox label="Include deleted users" />
</Stack>03
A group
Several under one question: the group's label is its legend, its value the checked values.
Tell me about
<CheckboxGroup label="Tell me about" name="events" defaultValue={["sign-ins"]}>
<Checkbox value="sign-ins" label="New sign-ins" />
<Checkbox value="invites" label="Accepted invites" />
<Checkbox value="billing" label="Billing changes" />
</CheckboxGroup>04
Select all
A parent checkbox, with the group's allValues: a dash while some are checked.
Tell me about
<CheckboxGroup label="Tell me about" allValues={["sign-ins", "invites", "billing"]} defaultValue={["sign-ins"]}>
<Checkbox parent label="Everything" />
<Checkbox value="sign-ins" label="New sign-ins" />
<Checkbox value="invites" label="Accepted invites" />
<Checkbox value="billing" label="Billing changes" />
</CheckboxGroup>05
Tiles
variant="tile": for choices that need explaining. The whole tile checks it.
Sign-in methods
<CheckboxGroup label="Sign-in methods" variant="tile" columns={2} defaultValue={["passkey"]}>
<Checkbox value="passkey" icon={FingerprintPatternIcon} label="Passkey" description="Face, fingerprint or a security key." />
<Checkbox value="otp" icon={ShieldCheckIcon} label="One-time code" description="From an authenticator app." />
<Checkbox value="email" icon={MailIcon} label="Email link" description="A link, valid for 10 minutes." />
<Checkbox value="password" icon={KeyRoundIcon} label="Password" description="With two-step sign-in." />
</CheckboxGroup>06
Invalid and disabled
The group's error says what's missing; a disabled option stays readable.
Tell me about
Choose at least one.
<CheckboxGroup label="Tell me about" error="Choose at least one.">
<Checkbox value="sign-ins" label="New sign-ins" />
<Checkbox value="billing" label="Billing changes" disabled description="Only billing admins get these." />
</CheckboxGroup>