Switch

A control for toggling between two states, such as on or off.

Installation

Import the component from the passport-ui package.

components/example.tsx
1import { Switch } from "passport-ui";

Usage

Basic example showing how to use the component.

components/example.tsx
1<Switch />
2
3{/* With variants */}
4<Switch variant="success" defaultChecked />
5<Switch variant="warning" defaultChecked />
6<Switch variant="destructive" defaultChecked />
7<Switch variant="info" defaultChecked />
8
9{/* Disabled state */}
10<Switch disabled />

Additional resources

Documentation and examples are available in Storybook.