sheengemologic ui
All components

Checkbox

A labeled native checkbox with controlled, uncontrolled, and mixed presentation.@gemologic/sheen · forms

Playground

Send alerts for this workspace.

<Checkbox label="Receive alerts" name="alerts" description="Send alerts for this workspace." />

Variant matrix

Opt in

Send alerts for this workspace.

Anatomy

Package
@gemologic/sheen
Source
packages/ui/src/primitives/Checkbox.tsx
Tokens
  • --sheen-color-border-control
  • --sheen-color-accent
  • --sheen-color-focus-ring
  • --sheen-icon-size-md

Accessibility

Role: checkboxKeyboard: Tab, Shift+Tab, Space

Do

  • Use mixed state for partial selections and update it explicitly.

Do not

  • Do not use a checkbox for an immediate on/off setting that needs switch semantics.

Generated props

NameTypeDefaultDescription
idstringRoot container ID, also used to derive stable internal IDs.
refHTMLDivElement | ((element: HTMLDivElement) => void)Root container reference; use inputRef for the native input.
onPointerDownNonNullable<JSX.EventHandlerUnion<HTMLDivElement, PointerEvent, JSX.EventHandler<HTMLDivElement, PointerEvent>> | undefined>Native root pointer-down handler, composed with primitive focus behavior.
label *stringRequired visible label.
descriptionstringSupporting text associated with the native input.
errorstringAssociated validation error; marks the input invalid without moving focus.
checkedbooleanApp-owned checked value, retained across form reset unless the app changes it.
defaultCheckedbooleanfalseInitial uncontrolled checked value restored on form reset.
indeterminatebooleanfalseApp-owned mixed presentation; clear it explicitly when resolving a partial selection.
onCheckedChange(checked: boolean) => voidReceives requested checked changes, not a DOM event.
disabledbooleanfalseDisables activation, keyboard focus, and form submission.
readOnlybooleanfalsePrevents changes while retaining focus and submission.
requiredbooleanfalseRequires this checkbox to be checked for native form validation.
namestringNative form field name; omitted or empty names are not submitted.
formstring | undefinedID of an owning form outside the input's ancestry; forwarded to the native input.
valuestringonSubmitted value when checked.
inputRef(element: HTMLInputElement) => voidReceives the native input; ref and remaining DOM props belong to the root container.
Native Solid/HTML attributes remain available and are omitted from this authored-prop view.