React InputSwitch

React InputSwitch

·

1 min read

React InputSwitch is used to select a boolean value.

Setup

Refer to PrimeReact setup documentation for download and installation steps for your environment.

Import

import {InputSwitch} from 'primereact/inputswitch';

Getting Started

InputSwitch is used as a controlled input with checked and onChange properties.

<InputSwitch checked={value} onChange={(e) => setValue(e.value)} />

Theming

InputSwitch supports various themes featuring Material, Bootstrap, Fluent as well as your own custom themes via the Designer tool.

Resources

Visit the PrimeReact InputSwitch showcase for demos and documentation.