Switch/switch-square-

PreviousNext

A switch/switch-square- example

Docs
shadcnblocksblock

Preview

Loading preview…
code/example/switch/switch-square-3.tsx
"use client";

import { useId } from "react";

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

export const title = "Square Switch with Label";

const Example = () => {
  const id = useId();

  return (
    <div className="flex items-center gap-2">
      <Switch className="rounded-sm [&_span]:rounded" defaultChecked id={id} />
      <Label htmlFor={id}>Enable notifications</Label>
    </div>
  );
};

export default Example;

Installation

npx shadcn@latest add @shadcnblocks/switch-switch-square-3

Usage

import { SwitchSwitchSquare3 } from "@/components/switch-switch-square-3"
<SwitchSwitchSquare3 />