Skip to content

shadcn.io is an independent project built on shadcn/ui

Free

Loading Button (Secondary) for Vue

A muted button, disabled, with a spinner while the action runs, when a supporting request should not be clicked twice.

UI library: Ark UI

Secondary styling, a spinner, and the word Loading. The button is disabled, so a second click does not start another request.

Use it for a side action like Sync or Duplicate. Keep the primary button free if people should still be able to press that. A Spinner by itself has no label. In Vue, Ark UI does not guess when your request is done.

Preview

Preview width

Installation

MCP · Pro
Make your AI a shadcn expert
Your agent installs components, builds pages and restyles your app from one prompt, in Claude Code, Cursor or VS Code.
Part of Pro

Anatomy

Button anatomy: root, icon, text

Usage

<Button :disabled="true" variant="secondary">
  <Spinner data-icon="inline-start" />Loading
</Button>

FAQ

Does this demo use isLoading?

No. It passes disabled, renders a Spinner with data-icon="inline-start", and keeps the word Loading. variant="secondary" is the quieter fill. Use it when a side action such as Sync is the one in flight, and the primary button should stay available.

When would I use isLoading instead?

isLoading hides the label visually, centers a spinner, keeps the button's width, sets aria-busy, and disables the button. Use this demo's pattern when the word should stay visible beside the spinner.

Why is the button disabled?

So a second click can't start the request again. You set disabled yourself here. isLoading does that for you. This demo doesn't.

Can the label say something other than Loading?

Yes. The children after the spinner are ordinary text. Saving, or Deleting 3 items, is fine. The demo says Loading so the state is obvious.

Will the spinner be announced as well as the word?

The spinner's default accessible name is Loading, and it has role="status". The button already says Loading, so pass aria-hidden on the spinner if once is enough. The demo doesn't.

Why loading on a secondary button?

variant="secondary" is the quieter fill. Use it when a side action such as Sync is the one in flight, and the primary button should stay available. The spinner uses the button's text color. It doesn't pick a variant of its own.

API Reference

Button

Sets disabled and variant="secondary". The rest is on the Button page.

Spinner

Sets data-icon="inline-start". The rest is on the Spinner page.