Özer

Loading Button

Buttons 617

About

A button that morphs its label through pending, success, and error states without layout shift when running an async action.

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

Code

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

Usage.tsx

import { LoadingButton } from "@/components/ui/loading-button";

export default function LoadingButtonDemo() {
  return (
    <div className="flex min-h-[320px] w-full items-center justify-center p-8">
      <LoadingButton
        onAction={() => new Promise((resolve) => setTimeout(resolve, 1600))}
        pendingLabel="Publishing…"
        successLabel="Published"
        errorLabel="Try again"
      >
        Publish
      </LoadingButton>
    </div>
  );
}

Dependencies

More by Özer

View all
  • Password Strength

    Password Strength

    1.3K
  • OTP Input

    OTP Input

    825
  • Progress Bar

    Progress Bar

    594
  • Reorder List

    Reorder List

    318
  • Task Steps

    Task Steps

    285
  • Hold to Confirm

    Hold to Confirm

    256
  • Reading Progress

    Reading Progress

    176
  • Press Depth

    Press Depth

    160

More in Buttons

View all
  • Texture Button

    Texture Button

    98
  • Button

    Button

    1
  • Button

    Button

    68
  • Eclipse Button

    Eclipse Button

    3
  • Button

    Button

    65
  • App Store Button

    App Store Button

    459
  • HeroUI Button Group

    HeroUI Button Group

    2
  • Base Button

    Base Button

    4