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 { Sun, Moon } from "lucide-react";

export default function IconToggleDemo() {
  return (
    <div className="flex items-center justify-center w-full h-screen bg-background">
      <IconToggle from={<Sun />} to={<Moon />} />
    </div>
  );
}

Dependencies

More by sopo

View all
  • Hover Card

    Hover Card

    2
  • Animated Select

    Animated Select

  • Animated Tabs

    Animated Tabs

  • Sheet

    Sheet

  • Animated Dialog

    Animated Dialog

More in Buttons

View all
  • Texture Button

    Texture Button

    109
  • Button

    Button

    15
  • Notification Button

    Notification Button

    117
  • Eclipse Button

    Eclipse Button

    44
  • HeroUI Button Group

    HeroUI Button Group

    2
  • Button Save

    Button Save

    50
  • Minimal Button

    Minimal Button

    14
  • App Store Button

    App Store Button

    486