Switch/switch-icons-

PreviousNext

A switch/switch-icons- example

Docs
shadcnblocksblock

Preview

Loading preview…
code/example/switch/switch-icons-1.tsx
"use client";

import { MoonIcon, SunIcon } from "lucide-react";

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

export const title = "Theme Toggle with Icons";

const Example = () => (
  <div className="flex items-center gap-2">
    <SunIcon className="size-4" />
    <Switch />
    <MoonIcon className="size-4 text-muted-foreground" />
  </div>
);

export default Example;

Installation

npx shadcn@latest add @shadcnblocks/switch-switch-icons-1

Usage

import { SwitchSwitchIcons1 } from "@/components/switch-switch-icons-1"
<SwitchSwitchIcons1 />