Codeways UI
Browse components

Forms

Switch

Takes effect immediately, no Save button.

@codeways/ui/switch

States

Takes effect immediately, no Save button - if the page has a Save button, use a Checkbox instead.

Usage

import { Switch } from "@codeways/ui/switch";
import { Label } from "@codeways/ui/label";

<div className="flex items-center gap-2">
  <Switch id="two-factor" checked={enabled} onCheckedChange={setEnabled} />
  <Label htmlFor="two-factor">Require two-factor sign-in</Label>
</div>