npx shadcn@latest add https://sketchcn.chuwii.com/r/switch.jsonimport { Switch } from "@/components/ui/switch";
export function SettingRow() {
const id = useId();
return (
<div className="flex w-full items-center justify-between gap-4">
<div className="flex flex-col">
<label htmlFor={id} className="text-sm">
Rough edges
</label>
<span className="text-muted-foreground text-xs">
Redraw every outline with a hand-drawn wobble.
</span>
</div>
<Switch id={id} defaultChecked />
</div>
);
}import { Switch } from "@/components/ui/switch";
export function AutosaveToggle() {
const [autosave, setAutosave] = useState(true);
return (
<div className="flex items-center gap-3">
<Switch
checked={autosave}
onCheckedChange={setAutosave}
aria-label="Autosave"
/>
<span className="text-sm">
Autosave is {autosave ? "on" : "off"}
</span>
</div>
);
}