Switch
A control that allows the user to toggle between checked and not checked.
import { Switch } from "stylus-ui/Switch";
export default () => <Switch />;Pass text or an element to label to display beside the switch. By default, the switch row will grow to accommodate the width of the parent container.
import { Switch } from "stylus-ui/Switch";
export default () => ( <form className="flex w-72 flex-col gap-3"> <Switch label="Override organization permissions" /> <Switch label="Enable documents export" /> </form>);Help text
Section titled “Help text”Pass text or an element to label to display beside the switch. By default, the switch row will grow to accommodate the width of the parent container.
import { Switch } from "stylus-ui/Switch";
export default () => ( <form className="w-72"> <Switch label="Scribe views" helpText="Enable notifications for when others view your Scribe" /> </form>);Disabled
Section titled “Disabled”Set disabled to prevent interaction with the switch.
import { Switch } from "stylus-ui/Switch";
export default () => ( <form className="w-72"> <Switch label="Scribe views" helpText="Enable notifications for when others view your Scribe" disabled /> </form>);API Reference
Section titled “API Reference”Switch
Section titled “Switch”Inherits properties from HTMLButtonElement.