Arihant jain

Morph Button

Buttons 8

About

An async action button that morphs between idle, loading, success, and error states with a spinner, a drawn-in check, and a shake on failure.

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

Code

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

Usage.tsx

"use client";

import React from "react";
import { MorphButton } from "@/components/ui/morph-button";

const fakeSave = () =>
  new Promise<void>((resolve) => setTimeout(resolve, 1200));

export default function MorphButtonDemo() {
  return (
    <div className="flex w-full flex-col items-center gap-5 py-10">
      <MorphButton
        onAction={fakeSave}
        loadingLabel="Saving"
        successLabel="Saved"
      >
        Save changes
      </MorphButton>
      <p className="text-sm text-neutral-500 dark:text-neutral-400">
        Click to run the full idle → loading → success cycle
      </p>
    </div>
  );
}

Dependencies

More by Arihant jain

View all
  • Footer section

    Footer section

    1.9K
  • Multistep Form

    Multistep Form

    710
  • Animated Drawer

    Animated Drawer

    694
  • Status Badge

    Status Badge

    514
  • Stacked Circular Footer

    Stacked Circular Footer

    427
  • Input Modal

    Input Modal

    330
  • Large Name Footer

    Large Name Footer

    199
  • Profile Dropdown

    Profile Dropdown

    196

More in Buttons

View all
  • Button

    Button

    1
  • Texture Button

    Texture Button

    97
  • Eclipse Button

    Eclipse Button

    39
  • App Store Button

    App Store Button

    458
  • HeroUI Button Group

    HeroUI Button Group

    2
  • Button

    Button

    4
  • Button

    Button

    65
  • Button

    Button

    68