Switch

A control that allows the user to toggle between checked and not checked. This component is an implementation of Switch component from radix-ui.

Size

Possible values are medium, large


Kind

Possible values are primary, secondary, tertiary


Disabled


isLoading


loadingColor


loadingSpeed


Type

Possible values are primary, secondary, tertiary


sliderColor

Color of circle inside switch


switchBackgroundColor

Object that needs a checked and unckecked color


enhancerIcons


focusOutlineColor

Color of the outline when is focused


Select Props

NameTypeDefaultRequiredDescription
idstringYesID of the element
handleChangefunctionNoFunction that allows to handle when switch is clicked
isLoadingbooleanNoShows a spinner while you are fecthing data
loadingColorstringwhiteNoSpinner color
loadingSpeednumber1NoDuration of the spinner animation
kindprimary | secondary | tertiaryprimaryNoSet defined styles of the component
typestandard | success | warning | error | disabledNoSet the style depending on the type
disabledbooleanNoSet input to disabled mode
sliderColorstringwhiteNoSet the color of circle inside switch
switchBackgroundColorchecked: string; unchecked: stringNoColor of checked and unchecked background
enhancerIconschecked: ReactNode; unchecked: ReactNodeNoImages that are rendered inside slider depending on current state
focusOutlineColorstringNoSet color of the outline when switch is focused using Tab key