Loading
Animated indicator for in-flight tasks, with ring, dot, and bar variants.
Basic
Variants
Each variant draws a different shape and uses its own keyframe animation. Rings work as general spinners, dots fit casual or passive contexts, bars suit processing or media.
Sizes
The SVG scales proportionally with any Tailwind sizing utility on class.
Colors
The indicator paints with currentColor, so any text-* utility sets the visible color.
Animation speed
duration sets one full animation cycle in milliseconds. Lower feels urgent, higher feels ambient.
Inside a button
Pair with <.button> and a disabled flag to reflect in-flight submissions and prevent duplicate sends.
Click-driven transitions
Toggle data-loading with JS.toggle_attribute/1, then drive the swap entirely in CSS with Tailwind's in-data-loading: variant. Click each button to play the animation.
Inline status
Loading overlay
While a server-side handle_event is in flight, Phoenix adds a phx-click-loading class to the source element. Tailwind's group-has-* variant on the wrapper picks that up to fade in an overlay, with no client state and no JS. Click Refresh now to see it live.
Refresh report data
Pulls the latest figures from the warehouse.
- Records
- 12,438
- Last sync
- 2 minutes ago
Chat typing indicator
dots-bounce reads as conversational. Pair it with a label inside chat or assistant surfaces.