dqnamo

Dynamic Button

Buttons

About

An animated button that smoothly resizes its width to fit new content and crossfades its label and icon whenever the action or state changes. Built with motion/react, it uses a spring width transition, a coordinated vertical fade for content swaps, and an active-press scale. Supports primary and secondary variants, an optional icon, content or full width, and respects reduced-motion preferences.

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

Code

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

Usage.tsx

"use client";

import { UsersIcon } from "@phosphor-icons/react";
import { DynamicButton } from "@/components/ui/dynamic-button";

export default function InviteTeammatesSecondary() {
  return (
    <div className="flex min-h-screen w-full items-center justify-center bg-white p-8">
      <DynamicButton variant="secondary" icon={<UsersIcon aria-hidden="true" size={15} weight="bold" />}>
        Invite teammates
      </DynamicButton>
    </div>
  );
}

Dependencies

More by dqnamo

View all
  • Agent Dock

    Agent Dock

    573
  • Animated Banner

    Animated Banner

    361
  • Scroll Fade List

    Scroll Fade List

    305
  • Model Selector Prompt

    Model Selector Prompt

    169
  • Game of Life Loader

    Game of Life Loader

    139
  • Animated Signature

    Animated Signature

    67
  • Iridescent Foil

    Iridescent Foil

    58
  • Scramble Text

    Scramble Text

    39

More in Buttons

View all
  • Texture Button

    Texture Button

    108
  • Button

    Button

    14
  • Notification Button

    Notification Button

    117
  • HeroUI Button Group

    HeroUI Button Group

    1
  • Base Button

    Base Button

    3
  • Button

    Button

    2
  • Button

    Button

    36
  • App Store Button

    App Store Button

    484