Checkbox
Binary toggle on a filled container surface in S/M/L sizes, with focus, hover, disabled and error states. The check mark is the Solar glyph style (CheckSquareBoldDuotoneIcon) and animates in with a spring. All colors come from tokens in @npolyhunter/ds/theme.css.
Playground
Live preview
Examples
Sizes
<Checkbox size="small" defaultChecked />
<Checkbox size="medium" defaultChecked />
<Checkbox size="large" defaultChecked />States
<Checkbox />
<Checkbox defaultChecked />
// Error — border uses status-danger-border; on focus it becomes 2px status-danger-foreground
// plus a danger-tinted ring
<Checkbox invalid />
<Checkbox invalid defaultChecked />
// Disabled — keeps the container surface, borders/box become subtle
<Checkbox disabled />
<Checkbox disabled defaultChecked />Code
import { Checkbox, Label } from "@npolyhunter/ui";
<div className="flex items-center space-x-2">
<Checkbox id="terms" />
<Label htmlFor="terms">Accept terms and conditions</Label>
</div>Code
const [checked, setChecked] = useState(false);
<Checkbox
size="${size}" // "small" | "medium" | "large"
checked={checked}
onCheckedChange={(value) => setChecked(value === true)}
invalid={invalid}
disabled={disabled}
/>Used in
Includes use through shared UI components.
AppBack Office
