Toggle

Used to select between two values.

Usage

import { Toggle } from 'rsuite';

Examples

Default

Size

The size property sets the switch size, and the value includes: lgmdsm.

Text and icon

Can be set by the checkedchildren, uncheckedchildren two properties, respectively, the display of the toggle state.

Disabled

Props

<Toggle>

Property Type (Default) Description
checked boolean Checked(Controlled)
checkedChildren React.Node Checked display content
classPrefix string 'toggle' The prefix of the component CSS class
defaultChecked boolean Default checked
disabled boolean Disabled
onChange (checked: boolean, event: SyntheticEvent) => void Callback function when state changes
size enum: 'lg', 'md', 'sm' Toggle size
unCheckedChildren React.Node Unselected display content
🎉 v5 is released! Head to the v5 documentation to get started.