Components / component

Loading Morph Button

v1.0.0 · premium

A pill that shrinks into a circle with a spinner while loading, then draws a check mark and returns to the label.

Loading Morph Button demo

Implementation

A pill that shrinks into a circle with a spinner while loading, then draws a check mark and returns to the label.

Framework
React 19.3.1 with TypeScript
Motion
Native CSS and browser APIs. No GSAP required.
Available modes
build
Version
1.0.0 · published

Source code

Download source ZIP
export function LoadingMorphButton({ children, status = 'idle', loadingLabel = 'Loading', successLabel = 'Done', onClick
  /** The idle label. */
  children: string;

Quality evidence

Export tested in 2 consumer projects with chromium, firefox, webkit. Evidence recorded on .

Changelog

v1.0.0 · A pill that shrinks into a circle with a spinner while loading, then draws a check mark and returns to the label.

Frequently asked questions

Who controls the state?

You do. Pass status as idle, loading or success. Set loading when a request starts, success when it finishes, and idle when you want the label back.

Is it announced to screen readers?

Yes. It sets aria-busy while loading and updates a polite live region with the loading and success labels. It stays focusable, so keyboard focus is never lost.