Skip to content

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

Free

Loading Icon Button Spinner for Vue

A disabled square button whose only content is a spinner. The button's accessible name is Loading.

UI library: Ark UI

A square button is disabled and holds only a spinner. There is no visible word. The button's name is Loading, and the spinner is hidden so it is not announced twice. No request runs.

Use it for a toolbar action such as refresh, where a label will not fit. Keep the accessible name. A labeled wait can use a normal button. A known percent fits Progress. In Vue, Ark UI would label the spinner Loading, so this file hides it.

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

Spinner anatomy: item, spinner, title

Usage

<Button aria-label="Loading" :disabled="true" size="icon-md">
  <Spinner aria-hidden="true" />
</Button>

FAQ

Why is the button a square?

size is icon-md on the Button, which is the icon-only size. The only child is a Spinner at the default size-4, so the wheel sits in the square with the button's padding around it.

Why is the icon button disabled?

So it can't be pressed again while it shows the spinner. disabled is set, and the square keeps its size at reduced opacity.

What name does the button have if there is no text?

aria-label is Loading on the Button, the name assistive tech reads. The Spinner has aria-hidden="true", so its own Loading status isn't announced twice.

Does this spinner need data-icon?

This file leaves data-icon off, because the spinner is the only child and there is no label to space it against. On a button that also has text, set data-icon to inline-start.

What color is the spinner in the square?

The icon uses currentColor, so it takes the button's text color. Add text-primary or text-muted-foreground on the Spinner when it should differ from the button.

How do I stop the spin for reduced motion?

Add motion-reduce:animate-none on the Spinner. The button stays disabled with aria-label Loading, and the icon stops.

API Reference

Button

Sets aria-label="Loading", disabled and size="icon-md". The rest is on the Button page.

Spinner

Sets aria-hidden. The rest is on the Spinner page.