Form controls
InputsField family built on native elements wherever natives already do the right thing: real inputs keep label association, form submission and mobile keyboards; Switch adds the ARIA switch role where no native exists.
import { TextField, Switch, Checkbox, RadioGroup } from "@componentforge/react";
Examples
Field family
Native inputs where possible; ids, describedby and invalid state are wired for you.
Accessibility
- TextField wires label[for], aria-describedby (hint + error ids) and aria-invalid automatically.
- Checkbox supports indeterminate via the DOM property; visuals are sibling-styled from :checked/:indeterminate states.
- Switch is role="switch" with aria-checked; RadioGroup renders native radios sharing a name so arrow-key roving comes natively.
Keyboard interactions
| Key | Action |
|---|---|
| Space | Toggle checkbox / switch. |
| ↑ / ↓ / ← / → | Move between radios (native behaviour). |
API reference
Selected props — every component also spreads native HTML attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
| checked / defaultChecked / onChange|onCheckedChange | boolean contracts | false | Every control supports both modes. |
| error / hint | string | — | Wires describedby ids + aria-invalid automatically. |
| indeterminate | boolean (Checkbox) | false | Mixed-state visual + DOM property. |