Spinner

The one loading spinner (snake), wherever something works for an unknown time.

$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/spinner.json

Sizes and places

16 in a Button (default), 20 in an icon slot, 22 in the FileField status badge. It takes currentColor. Motion: the arc stretches 1 → 45 and travels while the group turns once per 1.4 s (rotate linear, stretch ease-in-out). Reduced motion: no stretch, an 18-long arc turning slowly (2.8 s), so busy still shows.

162022currentColor
Kontrak kerja 2026.pdfMengunggah… 64%

When to use

  • Something works for an unknown time: Button loading (it is built in: icon, end icon or label slot), a FileField upload badge.
  • Every spinner in MaHR is this one. Never draw a border ring or a dot loader by hand.

When not to use

  • A known share (upload %, "43 dari 48") → Progress, next to its figure.
  • A page or card that loads → the skeleton at the ready size, not a spinner.
  • A third-party widget (the Cloudflare check on Masuk) keeps its own look.

Do and don't

DoLet the owner say it is busyThe Spinner is decorative (aria-hidden). The Button says it with aria-busy + loadingText ("Menyimpan…"), the upload badge with its label.
Don'tA second spinner styleA border ring, three dots or a custom loader next to the snake makes two loading languages. One spinner, everywhere.

Installation

Add Spinner with the shadcn CLI (your project needs a components.json and the MaHR theme: https://mahrdesign.faizintifada.com/r/theme.json), or copy the files by hand.

terminal
bunx --bun shadcn@latest add https://mahrdesign.faizintifada.com/r/spinner.json

API

import { Spinner } from "@/components/ui/spinner"
PropTypeDefaultDescription
sizenumber1616 Button · 20 icon slot · 22 FileField badge.
classNamestring–Colour comes from the text colour (currentColor), e.g. text-muted-foreground.