Docs

Switch

Switch

A control that allows the user to toggle between checked and not checked.

Label
import * as React from "react";
 
import { Switch } from "@/components/ui/switch";
import { Stack } from "@/components/ui/stack";
 
export function SwitchExample(): React.JSX.Element {
  return (
    <Stack alignItems="center" direction="row" gap={2}>
      <Switch />
      <span>Label</span>
    </Stack>
  );
}

Installation

npx lotru@latest add ui/switch

Usage

import { Switch } from "@/components/ui/switch";
<Switch />

On this page