Loading Button

Overview

A shadcn/ui button with a built-in loading spinner state.

This action component is intended for interfaces that need a shadcn/ui button with a built-in loading spinner state, SaaS workflows, and onboarding flows. Its implementation is provided as editable source so the final behavior and styling stay inside your project.

Technologies

React
TypeScript
Tailwind CSS
shadcn/ui
Radix UI
Next.js

Detected package dependencies: class-variance-authority, @radix-ui/react-slot.

@spectrumui/loading-button-demo

Installation

Login to view commandCreate a free account to access the install command

Usage

@spectrumui/loading-button-usage

asChild

@spectrumui/loading-button-as-child

Props

PropTypeRequiredDescription
asChildbooleanNoValue accepted by the asChild property in the exported source type.
loadingbooleanNoValue accepted by the loading property in the exported source type.

Use cases

  • interfaces that need a shadcn/ui button with a built-in loading spinner state
  • SaaS workflows
  • onboarding flows

Features

  • Copy-paste source that remains in your repository
  • TypeScript source included with the component
  • Tailwind CSS classes editable in the component source
  • shadcn/ui dependencies: local UI primitives
  • Spectrum UI registry dependencies: @spectrumui/loading-button-dependencies
  • Responsive Tailwind variants present in the source

Accessibility

  • The source uses Radix UI primitives for the interactions detected on this component.
  • Test focus order, keyboard operation, labels, contrast, and screen-reader output in the final application context.

Customization

  • Edit the Tailwind utility classes in the copied source to match your spacing, color, and typography tokens.
  • Use the documented className surface for local layout adjustments, then edit the source for structural changes.

Topic guides

See how this component fits into broader interface patterns, implementation decisions, and working examples.

Loading Button FAQ

Is Loading Button free to use in commercial projects?

Yes. The public Loading Button source is available under the Apache License 2.0, including for commercial use, subject to the LICENSE terms.

How do I install Loading Button?

Run npx shadcn@latest add @spectrumui/loading-button-demo or npx shadcn@latest add @spectrumui/loading-button-usage or npx shadcn@latest add @spectrumui/loading-button-as-child. The page also exposes the source for manual installation.

Does Loading Button require Motion?

No Motion dependency was detected in the documented source or registry entry for Loading Button.

Does Loading Button use shadcn/ui or Radix UI?

Loading Button uses local shadcn/ui primitives and imports Radix UI directly.

Can I use Loading Button in Next.js?

The documented React source is used in this Next.js application. Keep its use client directive when copying it into the App Router. Install the detected dependencies and verify any application-specific data or image configuration.

What accessibility checks should I run for Loading Button?

The source includes Radix UI primitives. Test the finished interface with keyboard and screen-reader workflows.