Loading
Announce indeterminate work with a compact animation.
Preview
Example
<.loading variant={:spinner} label="Loading reports" />
API contract
loading/1 uses declared Phoenix attributes and slots. This table is generated from the compiled component metadata.
| Attribute | Type | Required | Default | Accepted values |
|---|---|---|---|---|
variant |
:atom |
No | :spinner |
[:spinner, :dots, :ring, :ball, :bars, :infinity] |
size |
:atom |
No | :md |
[:xs, :sm, :md, :lg, :xl] |
label |
:string |
No | "Loading" |
Any value matching the declared type |
class |
:any |
No | nil |
Any value matching the declared type |
States and behavior
Semantic text accompanies visual treatment so status is not conveyed through color or motion alone.
Keyboard and accessibility
The component itself does not add a keyboard interaction. Any slotted action must remain a labelled native control.