Forms
Switch
A setting that takes effect at once: on or off, with no Save button.
Forms
A setting that takes effect at once: on or off, with no Save button.
Change the props on the right. The switch and its code follow.
import { Label } from 'omuk-ui/label';
import { Switch } from 'omuk-ui/switch';
<div className="flex items-center gap-2">
<Switch id="lock" defaultChecked />
<Label htmlFor="lock" className="font-normal">Lock production</Label>
</div>A switch acts at once: save the change in onCheckedChange, with no Save button. Off, it looks like an empty checkbox; on, the knob grows, slides and shows a tick.
In a horizontal Field, the title and the description come first and the switch sits at the end of the row.
Show dots in place of each value until you reveal it.
Add an entry to the audit log each time the CLI reads.
The default track is 44 by 24; sm is 36 by 20, for a row in a table. Disabled has the hover fill, a thin edge and a pale knob, and a Label after it turns muted.
And every prop of a <button>.