Switch

Switch component to render toggle.

Usage

The Switch component can be imported using

import { Switch } from '@tail-kit/tail-kit'

Default Switch

Controlled Switch

Disabled Switch

Switch Props

NameDescriptionDefault Value
checked
whether the switch is on on | off state
boolean | undefined
--
defaultChecked
Property to initialize switch with a particular value
boolean | undefined
--
disabled
Disable switch
boolean | undefined
--
onChange
function called when the state of switch is changed
((event: ChangeEvent<HTMLInputElement>) => void) | undefined
--
className
additional class names
string | undefined
--
style
addtional styles
CSSProperties | undefined
--