@fluentui/react-switch
TypeScript icon, indicating that this package has built-in type declarations

9.1.79 • Public • Published

@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:

  1. yarn start
  2. 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.

/@fluentui/react-switch/

    Package Sidebar

    Install

    npm i @fluentui/react-switch

    Weekly Downloads

    78,689

    Version

    9.1.79

    License

    MIT

    Unpacked Size

    224 kB

    Total Files

    37

    Last publish

    Collaborators

    • sopranopillow
    • microsoft1es
    • justslone
    • chrisdholt
    • miroslavstastny
    • levithomason
    • uifabricteam
    • uifrnbot
    • dzearing
    • layershifter
    • ling1726
    • travisspomer