Abraham

Switch

Buttons

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 SwitchSquare() {
  return (
    <div className="bg-white dark:bg-gray-800 w-full px-4 py-12 rounded-xl flex items-center justify-center">
      <Switch.Root className="flex items-center gap-3">
        <Switch.Control className="relative inline-flex w-11 p-0.5 items-center rounded-md bg-gray-300 transition-colors duration-200 ease-in-out data-[state=checked]:bg-blue-500 data-focus-visible:ring-2 data-focus-visible:ring-gray-300/50 data-[state=checked]:data-focus-visible:ring-blue-500/50 dark:bg-gray-600 dark:data-[state=checked]:bg-blue-500">
          <Switch.Thumb className="w-5 h-5 rounded-sm 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

    116
  • Carousel

    Carousel

    85
  • timeline-animation

    timeline-animation

    70
  • Basic Toast

    Basic Toast

    60
  • Calendar

    Calendar

    58
  • QR Code

    QR Code

    54
  •  Menu

    Menu

    53
  • Steps

    Steps

    53

More in Buttons

View all
  • Button Group

    Button Group

    4
  • Button

    Button

    20
  • Texture Button

    Texture Button

    111
  • Button

    Button

    4
  • Hero Button

    Hero Button

    23
  • Button

    Button

    143
  • Astryx Chat Send Button

    Astryx Chat Send Button

    5
  • Button Group

    Button Group