Skip to content

Switch

Components5.7.2

Switch

import Switch from '@semcore/ui/switch';
<Switch />;
typeSwitchProps
BoxProps & NeighborLocationProps & {...}
PropertyDescription
size
"m" | "l" | "xl" = m

Switch size

theme

Switch theme

Switch.Value

import Switch from '@semcore/ui/switch';
<Switch.Value />;
typeSwitchValueProps
BoxProps & NeighborItemProps & KeyboardFocusProps & {...}
PropertyDescription
onChange
(checked: boolean, e: React.SyntheticEvent) => void

Handler on change

checked
boolean

Control state

defaultChecked
boolean = false

Initial state for uncontrolled mode

disabled
boolean

Disabled state

includeInputProps
string[]

The list of properties that can be placed in the hidden input

theme

Switch theme

Switch.Addon

import Switch from '@semcore/ui/switch';
<Switch.Addon />;
typeSwitchAddonProps
BoxProps & NeighborItemProps & {...}