switch

v4.15.0arrow_drop_down
v4.15.0
STATUS
Passing
DOWNLOADS
66
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
N/A
The Switch component is used as an alternative for the Checkbox component. Except indeterminate and label are not supported.
1 contributor
Install switch as a package?
Copied
npm i @bit/segmentio.evergreen.switch
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
modifieddraft
chevron_left
chevron_right
Properties
NameTypeDefault valueDescription
id
string

The id attribute of the radio.

name
string

The name attribute of the radio.

value
string

The value attribute of the radio.

height
number16

The height of the switch.

checked
bool

When true, the switch is checked (on).

onChange
function() => {}

Function called when state changes.

disabled
boolfalse

When true, the switch is disabled.

isInvalid
bool

When true, the switch is invalid.

appearance
string'default'

The appearance of the checkbox. The default theme only comes with a default style.

hasCheckIcon
booltrue

When true, the switch has a check icon.

defaultChecked
bool

When true, the switch is true by default. This is for uncontrolled usage.

theme
(required)
object

Theme provided by ThemeProvider.

Help and resources