---
name: choice
category: inputs
summary: "Checkbox, switch and radio-group form toggles"
subpath: "@42/core/choice"
---

Form toggles: `Checkbox` (tri-state), `Switch` (on/off), `RadioGroup` (roving radios).

```html
<button data-c42-checkbox>Accept</button>
<button data-c42-switch>Notifications</button>
<div data-c42-radio-group>
  <div data-c42-radio data-value="a">A</div>
  <div data-c42-radio data-value="b">B</div>
</div>
```

```ts
import { Checkbox, Switch, RadioGroup } from '@42/core/choice';
new Checkbox(el, { checked: false, indeterminate: false, disabled: false });
new Switch(el, { checked: false });
new RadioGroup(el, { defaultValue: 'a' });
```

Events: `checkbox:change` → `{ checked, indeterminate }`, `switch:change` → `{ checked }`, `radio:change` → `{ value: string | null }`
