Skip to main content
NetScriptdocs Search docs ⌘K v0.0.9
Browse documentation

Checkbox

CSS-first native checkbox seam with inline label and helper copy.

All components · Theme builder · Implementation source

Live preview

Open live checkbox preview

Install

Shell
netscript ui:add checkbox

Usage and examples

The preview runs this JSX with the installed components. Import any composed primitives from your UI directory.

TypeScript
import { useState } from 'preact/hooks';
import { Checkbox } from '@app/components/ui/checkbox.tsx';

export function Example() {
  const [value, setValue] = useState('standard');
  const [open, setOpen] = useState(false);
  const [notice, report] = useState('');
  return (<><div><Checkbox description="Includes a tracking link">Email the customer</Checkbox></div><p role="status">{notice}</p></>);
}

Props

Generated from native deno doc --json --private over the shipped implementation. Compound component props retain their owning interface; native attributes pass through where declared.

OwnerPropTypeOptionalDescription
CheckboxPropschildrenComponentChildrenNo
CheckboxPropsclassstringYes
CheckboxPropsdescriptionComponentChildrenYes
CheckboxPropserrorbooleanYes
TypeScript
CheckboxProps extends Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "type" | "class" | "children">

Keyboard

KeyAction
SpaceToggle checked

Tokens

Semantic contract roles: border/control, border/input, border/width, destructive/default, primary/default, primary/fg, surface/card, text/fg, text/muted.

CSS custom properties referenced directly: --ns-border-control, --ns-border-hover, --ns-border-width, --ns-card, --ns-destructive, --ns-ease-normal, --ns-input-border, --ns-primary, --ns-primary-fg, --ns-primary-stroke, --ns-radius-checkbox, --ns-radius-sm, --ns-size-checkbox, --ns-surface.

Contract and compatibility

Accessibility pattern: WAI-ARIA guidance

  • Native DOM attributes pass through where the implementation accepts them.

Design contract values marked planned are not implementation props. The props above describe what ships today.

Search all documentation

Type a term to search the documentation.