Spinner
The one loading spinner (snake), wherever something works for an unknown time.
$ npx shadcn@latest add https://mahrdesign.faizintifada.com/r/spinner.jsonSizes and places
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
Let 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.
A 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.
API
import { Spinner } from "@/components/ui/spinner"| Prop | Type | Default | Description |
|---|---|---|---|
size | number | 16 | 16 Button · 20 icon slot · 22 FileField badge. |
className | string | – | Colour comes from the text colour (currentColor), e.g. text-muted-foreground. |