List
Default to the inactive state.
Default to the active state.
Shown in disabled mode.
Icons
Pass icons through the inactiveChild
and activeChild
snippets respectively.
Compact
Apply the compact
prop to switch a minimal display.
Lightswitch
This is a full fledge example using multiple features.
API Reference
Switch
Property | Type | Description |
---|---|---|
name * | string | |
checked | boolean | |
disabled | boolean | |
compact | boolean | |
base | string | |
classes | string | |
stateFocused | string | |
controlBase | string | |
controlInactive | string | |
controlActive | string | |
controlDisabled | string | |
controlWidth | string | |
controlHeight | string | |
controlPadding | string | |
controlRounded | string | |
controlHover | string | |
controlClasses | string | |
thumbBase | string | |
thumbInactive | string | |
thumbActive | string | |
thumbRounded | string | |
thumbTranslateX | string | |
thumbTransition | string | |
thumbEase | string | |
thumbDuration | string | |
thumbClasses | string | |
labelBase | string | |
labelClasses | string | |
iconInactiveBase | string | |
iconActiveBase | string | |
children | Snippet<[]> | |
inactiveChild | Snippet<[]> | |
activeChild | Snippet<[]> | |
ids | Partial<{ root: string; hiddenInput: string; control: string; label: string; thumb: string; }> | |
label | string | |
invalid | boolean | |
required | boolean | |
readOnly | boolean | |
onCheckedChange | (details: CheckedChangeDetails) => void | |
form | string | |
value | string | number | |
dir | "ltr" | "rtl" | |
getRootNode | () => ShadowRoot | Node | Document | |