Skip to content

Forms

ISwitch

A toggle for a setting that takes effect immediately. Where the change is saved with the rest of a form, use ICheckbox.

With a description

description sits under the label and is wired to the switch, so it is announced as part of the control.

A Monday summary of everything sent, paid and overdue.

Sizes

The track, thumb and travel scale together.

Disabled

Without a label

Leave label off and the switch renders alone. Give it an aria-label, or point a separate ILabel at it with id.

Props

PropTypeDefaultDescription
labelstringText beside the switch, wired to it
descriptionstringSecondary line under the label
size'sm' | 'md' | 'lg''md'Control scale
idstringgeneratedUseful when an external ILabel targets it
unstyledbooleanDrop built-in classes
classstringMerged with the built-in classes
ui{ wrapper?, root?, thumb?, content?, label?, description? }Per-slot class overrides

disabled, required, name and value are forwarded to Reka UI's SwitchRoot, so the switch posts in a plain <form>.

Inside an IFormField the label, description and error come from the field — set them there rather than here.