@fluentui/react-switch
v9.1.98
Published
Fluent UI React Switch component.
Downloads
430,190
Maintainers
Keywords
Readme
@fluentui/react-switch
Switch components for Fluent UI React
The Switch
control enables users to trigger an option on or off through interacting with the component.
Usage
To import Switch:
import { Switch } from '@fluentui/react-components';
Examples
<Switch />
<Switch defaultChecked required />
<Switch checked onChange={onChange} />
<Switch disabled />
<Switch label="Enable dark mode" labelPosition="after" />
See Fluent UI Storybook for more detailed usage examples.
Alternatively, run Storybook locally with:
yarn start
- Select
react-switch
from the list.
Specification
See SPEC.md.
Migration Guide
If you're upgrading to Fluent UI v9 see MIGRATION.md for guidance on updating to the latest Switch implementation.