Skip to main content

Switch

import { Switch } from '@tulsa/core';

<Switch />
<Switch label={"With a label"} checked />
<Switch disabled label={"Disabled"} />

Props

NameTypeDescriptionDefault
idstringManually sets the id and accessibility of the `for` attribute of the associated label
labelstringAssociated label of the box
labelPropsHTMLProps<"label">Props that are applied to the root of the label

Native props are forwarded to the root component.

Examples

Sizes

<Switch size="sm" label="Small" />
<Switch size="md" label="Medium" />
<Switch size="lg" label="Large" />