Components

Toggle

Switches a labelled setting on or off.

tsx
import Toggle from '@precursor/toggle';

Example

tsx
import Toggle from '@precursor/toggle';

export default function Example() {
    return <Toggle name="notifications" label="Notifications" />;
}

Props

Toggle props
PropTypeDefaultNotes
labelstring——
size"s" | "m" | "l"'m'—
classNamestring——
aria-describedbystring——
aria-invalidboolean——
disabledboolean——
idstring——
nameRequiredstring——
typeInputTypes——
defaultValuestring——
valuestring——
checkedboolean——
state"success" | "error" | "warning"——
onChangeChangeEventHandler<HTMLInputElement>——