Checkbox
input
Checkbox: a toggleable boolean input with a label
Terminal
$termuijs render checkbox
Installation
$ bunx termuijs add checkbox
Copies the source into src/components/checkbox/ and installs @termuijs/core, @termuijs/widgets.
Usage
ts
import { Checkbox } from '@termuijs/widgets'ts
new Checkbox(label: string, style: Partial<Style> = {}, opts: CheckboxOptions = {},)API Reference
Checkbox
| Prop | Type | Required | Description |
|---|---|---|---|
label | string | required | — |
checked | boolean | optional | Initial checked state |
onChange | (checked: boolean) => void | optional | Callback fired when checked state changes |
checkedChar | string | optional | Character shown when checked |
uncheckedChar | string | optional | Character shown when unchecked |
disabled | boolean | optional | Whether the checkbox is disabled |
checkedColor | Color | optional | Color of the check mark |