sopo

Icon Toggle

Buttons

About

A button that smoothly morphs between two icons when clicked, useful for copy-to-clipboard confirmations or theme toggles.

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

Code

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

Usage.tsx

import { IconToggle } from "@/components/ui/icon-toggle";
import { Copy, Check } from "lucide-react";

export default function IconToggleAutoResetDemo() {
  return (
    <div className="flex items-center justify-center w-full h-screen bg-background">
      <IconToggle
        autoReset
        from={<Copy className="size-6" />}
        to={<Check className="size-6" />}
      />
    </div>
  );
}

Dependencies

More by sopo

View all
  • Hover Card

    Hover Card

    4
  • Sheet

    Sheet

    3
  • Animated Select

    Animated Select

  • Animated Tabs

    Animated Tabs

  • Animated Dialog

    Animated Dialog

More in Buttons

View all
  • Button

    Button

    20
  • Button

    Button

    3
  • Button Group

    Button Group

    18
  • Button

    Button

    149
  • Icon Label Subtext Button

    Icon Label Subtext Button

    69
  • Button

    Button

    9
  • Button

    Button

    37
  • Texture Button

    Texture Button

    113