Navigation

Uplift UI Docs

Icon Morph Button

A button with animated icon morphing, sliding text, and a pulsing background. Perfect for creative, modern, and interactive UIs.

Demo

Interactive Demo

Hover to see the icon morph and background pulse.

Installation

Install the required dependencies to get started:

bash
Loading...

Type Integration

Add the following interface to your types file for consistent props and TypeScript support.

typescript
Loading...

Usage

Import and use the IconMorphButton component in your Next.js application:

tsx
Loading...

Props

PropTypeDefaultDescription
childrenReact.ReactNodeundefinedThe button label or content inside the button.
initialIconReact.ReactNode<ArrowRight size={18} />Icon to display by default before hover.
hoverIconReact.ReactNode<Check size={18} />Icon to display when the button is hovered.
classNamestring""Additional Tailwind or CSS classes to style the button.
onClick() => voidundefinedClick handler function executed on button press.
disabledbooleanfalseDisables the button if set to true.
type"button" | "submit" | "reset""button"HTML button type attribute.

Features

  • Animated icon morphing between two icons on hover
  • Text slides slightly left on hover
  • Background pulse animation on hover
  • Gradient background and rounded corners
  • Customizable icons and label
  • Framer Motion-powered transitions
  • TypeScript support
  • Production-ready and accessible

Dependencies

Next.js 15+
Framer Motion
Tailwind CSS (recommended)
TypeScript (recommended)