jshguo

Switch

Forms 139

About

Toggle switch component built on Radix UI with smooth animation and focus states.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Switch to your project and fits it to your theme.

Code

How Switch is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client"

import { Switch } from "@/components/ui/interfaces-switch"

export default function SwitchDemo() {
  return (
    <div className="flex w-full min-h-screen items-center justify-center bg-background p-8 overflow-hidden">
      <div className="flex items-center gap-3">
        <Switch id="airplane-mode" defaultChecked />
        <label htmlFor="airplane-mode" className="text-sm font-medium cursor-pointer">
          Airplane Mode
        </label>
      </div>
    </div>
  )
}

Dependencies

More by jshguo

View all
  • Progress

    Progress

    428
  • Select

    Select

    375
  • Textarea

    Textarea

    261
  • Input OTP

    Input OTP

    161
  • Interfaces Carousel

    Interfaces Carousel

    161
  • Hover Card

    Hover Card

    110
  • Card

    Card

    86
  • Interfaces Breadcrumb

    Interfaces Breadcrumb

    63

More in Forms

View all
  • Premium Auth

    Premium Auth

    550
  • Contact Card

    Contact Card

    1.1K
  • Login 2

    Login 2

    10
  • Form

    Form

    17
  • Book A Demo 3

    Book A Demo 3

    96
  • Form

    Form

    20
  • Login 1

    Login 1

    59
  • SignInPage

    SignInPage

    721