Skip to main content

Switch (Item)

caution

All props/parameters are optional unless they are marked with an asterisk ( * ).

Example

import { components } from "replugged";
const { SwitchItem } = components;

export function Settings(): React.ReactElement {
return <SwitchItem {...util.useSetting(cfg, "foo", true)}>Switch title</SwitchItem>;
}

Props

NameTypeDefaultDescription
checked* booleanSwitch state; use value with the Item component instead
classNamestringComponent class name
disabledbooleanfalseWhether the switch is disabled
focusPropsRecord<string, unknown>Props for the FocusRing component
hideBorderbooleanfalseWhether a divider is not displayed at the end of the switch item
idstringInput element id
innerRefRef<unknown>Inner ref
notestringDescription of what the switch item is about
onChange* (value: boolean) => voidFunction ran on state change
styleCSSPropertiesComponent style
tooltipNotestringTooltip text displayed on the switch item
value* booleanSwitch item value