Get License
Free
Pro

Progress Button

<base-progress-button> is a button with built-in progress state. While loading is true the label fades out — keeping the button's width stable — and a centered spinner takes its place. It wraps base-button, so every color, size, and width is supported.

free

Live demo

Click the button to start a simulated save. The label is swapped for a spinner while the button keeps its exact width, and it is blocked until the operation completes.


HTML

Colors

Use color like on base-button; the spinner color is derived automatically so it stays visible on every background. Override it with spinnerColor if needed.


HTML

Sizes

Use size like on base-button. The spinner is 20×20px on the default size and scales proportionally with the button — click any of them to see it.


HTML

Usage notes

  • Bind [loading] to your async operation and set it back to false when done.
  • The (clicked) output only fires while the button is enabled and not loading.
  • While loading the button blocks interaction without changing its look — no disabled fade — and gets aria-disabled plus aria-busy.
  • Use width="100%" for full-width actions that must not jump during loading.

Installation

Run the following command to add this component to your project:

bash

npx base-ui-cli add progress-button

API Reference

Base UI provides standalone components. Import the exact elements you want to use into your component.

typescript (Example)

import { ProgressButtonComponent } from '@lussos/base-ui';

@Component({
  selector: 'app-your-component',
  imports: [
    ProgressButtonComponent
  ],
  template: `...`
})
export class YourComponent {}

Properties for progress-button — generated from JSDoc in the library source.

API reference for progress-button
SelectorPropertyTypeDefaultDescription
base-progress-buttonclassstring''Extra host classes merged via `cn()`.
base-progress-buttonloadingbooleanfalseWhether the progress spinner is shown and the button blocks interaction. The button keeps its normal appearance while loading — no disabled fade — it just swaps the label for the spinner.
base-progress-buttoncolorButtonColor | string'primary'The semantic visual color, forwarded to `base-button`.
base-progress-buttonsizeButtonSize'default'The button size, forwarded to `base-button`.
base-progress-buttonwidthstring''Optional custom width (e.g. `'100%'`), forwarded to `base-button`.
base-progress-buttontype'button' | 'submit' | 'reset''button'Native button type.
base-progress-buttondisabledbooleanfalseWhether the button is disabled.
base-progress-buttonspinnerColorSpinnerColor | undefinedundefinedOverride the spinner color; by default it is derived from `color`.
base-progress-button(clicked)voidEmits when the button is clicked while enabled and not loading.

Theme Customizer

Customize your UI instantly.

Primary Color

Border Radius

Background

Mode

Copy these styles to paste into your project's global CSS and Tailwind config.