Pular para o conteúdo principal

Switch

Import

import { Switch } from '@resultadosdigitais/tangram-components'

Properties

checked

Typebool

Description

Sets the initial state. Used for Controlled component.

defaultChecked

Typebool

Description

Sets the default value. Used for Uncontrolled component.

disabled

Typebool
Defaultfalse

Description

Sets if is disabled.

labelStart

Typebool
Defaultfalse

Description

Sets the label to be displayed at before the Switch.

hideLabel

Typebool
Defaultfalse

Description

Sets if the label is hidden.

id

Typestring

Description

Sets the id.

label

Typenode

Description

Sets the label.

value

Typestring

Description

Sets a value when Switch is checked.

onChange

Typefunc
ParamnewState boolean - The new state about if is checked.

Description

Callback fired when the Switch changes.

onFocus

Typefunc
Paramevent React.SyntheticEvent - The event source of the callback.

Description

Callback fired when the Switch is focused.

onBlur

Typefunc
Paramevent React.SyntheticEvent - The event source of the callback.

Description

Callback fired when the input is blurred.

rootRef

Typefunc | shape
Defaultnull

Description

Pass a ref to the element wrapper.

Feedback