Toggle

React component for a checkbox or radio input.

GitHub icon Module source

Unpkg icon Unpkg CDN

CSS

This component module has a css export that’s a Set instance containing the URL strings of the CSS files that must be loaded for this component to display correctly (excluding theme and global CSS).

Props

The React component props are documented via TypeScript JSDoc comments in the module source.

Examples

A checkbox input.

Code

A required checkbox input.

Code

A checkbox input with a custom validation message.

Code

A radio input group.

Code

Using an input element ref.

Code