Skip to main content

Variants

Six colours and one for coloured backgrounds. The icon takes the text colour, so any text-* class works. icon sets another Font Awesome icon. Each variant is at least 3:1 against the card in light and dark mode. On a coloured background use text-white.

Primary task loading primary
Dominant task loading dominant
Success task loading success
Info task loading info
Warning task loading warning
Danger task loading danger
Loading on a coloured background on colour
Custom icon loading custom icon

Sizes

Five sizes: 12, 16, 24, 32 and 48 px. The spinner is an icon that turns with the Font Awesome fa-spin animation. If the person has asked for less motion, Font Awesome keeps it still. It has role="status" and a hidden text, so a screen reader announces "Loading".

Loading xs
Loading sm
Loading md
Loading lg
Loading xl

With text

When the text is visible, put role="status" on the wrapper instead of the spinner, and hide the spinner from assistive tech by leaving out its own role and text. The second example is a loading state for a whole area.

Loading Loading…
Loading

Loading orders

This can take a few seconds.

In buttons

A button that is waiting uses the loading prop of the button: it shows its own spinner, is disabled so it cannot be pressed twice, and has aria-busy="true". An icon-only button needs an aria-label.

In a field

A small spinner at the end of a field, for a search that waits for the server. The field has aria-busy="true", and the spinner announces "Searching".

Searching

The spinner shows while the list is loading.

Overlay

A layer over content that is being refreshed, such as a table. The area has aria-busy="true", and the layer covers it with absolute inset-0 and a translucent background.

Order 1041 $129.00
Order 1040 $48.50
Order 1039 $210.00
Loading Updating…