Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Input Group examples · Spinner

Animated Icon Spinner Input Group for React

A disabled input with a spinning loader at its start and a Please wait note at its end.

Framework
UI library

A field that's busy: the input is disabled, a loader icon spins at its start and Please wait... sits at its end, so people know the value is being refreshed. Swap the spinner out when the data arrives.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

What makes the icon spin?

animate-spin on the LoaderIcon. For a ready-made one, use the Spinner component, as in Loading States.

How is the field disabled?

disabled on InputGroupInput blocks typing. data-disabled="true" on InputGroup dims the addons.

What is Please wait...?

An InputGroupText with text-muted-foreground in an inline-end addon.

Why is the loader at the start?

Its addon keeps the default inline-start align. Both addons are written after the input.

Is the loading announced?

The loader is aria-hidden. To announce the wait, put Please wait... in a polite live region or set aria-busy on the region being refreshed.

Does the spin respect reduced motion?

Add motion-reduce:animate-none to the icon if you want it still for people who ask for less motion.