Abraham

Switch

Forms

About

Here is Switch component

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 "@ark-ui/react/switch";

export default function SwitchDisabled() {
  return (
    <div className="bg-white dark:bg-gray-800 w-full px-4 py-12 rounded-xl flex items-center justify-center">
      <Switch.Root disabled className="flex items-center gap-3">
        <Switch.Control className="relative inline-flex w-11 p-0.5 items-center rounded-full bg-gray-200 transition-colors duration-200 ease-in-out data-[state=checked]:bg-gray-400 data-focus-visible:ring-2 data-focus-visible:ring-gray-400/50 opacity-40 cursor-not-allowed dark:bg-gray-700 dark:data-[state=checked]:bg-gray-600">
          <Switch.Thumb className="w-5 h-5 rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out data-[state=checked]:translate-x-full" />
        </Switch.Control>
        <Switch.HiddenInput />
      </Switch.Root>
    </div>
  );
}

Dependencies

More by Abraham

View all
  • Signature Pad

    Signature Pad

    113
  • Carousel

    Carousel

    85
  • timeline-animation

    timeline-animation

    67
  • Basic Toast

    Basic Toast

    59
  • Calendar

    Calendar

    58
  •  Menu

    Menu

    53
  • QR Code

    QR Code

    52
  • Steps

    Steps

    47

More in Forms

View all
  • Contact Card

    Contact Card

    1.1K
  • Premium Auth

    Premium Auth

    559
  • Book A Demo 1

    Book A Demo 1

    88
  • Form

    Form

    139
  • Authentication Card

    Authentication Card

    51
  • Book A Demo 3

    Book A Demo 3

    99
  • Login 2

    Login 2

    11
  • SignInPage

    SignInPage

    740