Switch
Turns one setting on or off right away. Passed through from shadcn (Base UI Switch) until Pilar restyles it.
Usage
import { Switch } from '@pilar-amoda/ui/switch';With a label
Put the label after the switch; checked and onCheckedChange control it.
import { Label } from '@pilar-amoda/ui/label';
import { Switch } from '@pilar-amoda/ui/switch';
export const SwitchBasic = () => (
<div className="flex items-center gap-2">
<Switch id="switch-example" data-testid="switchNotify_Switch" />
<Label htmlFor="switch-example">Kirim notifikasi</Label>
</div>
);Do and don't
Do: use it for a setting that applies or shows more fields at once.
Don't: use it to pick several items from a list; use Checkbox.