docs / core / loading-overlay
LoadingOverlay
a dimming scrim with a centered spinner, over its parent while it loads or over the whole page.
intensity · recedesrsc · client
provenance
shaped from sisu-pluslayer
core / primitivesintensity
recedes · safe anywhere, including dense surfacescomposition
over a positioned panel or Card while its data loadscontain="viewport" for whole-page transitions, even over an open modalnot for button-level loading. Button has a status machinenot a Dialog scrim. it dims content, it does not trap focusa11y
the spinner is arole="status" region announcing the label once · the visible caption is aria-hiddenjest-axedependencies
Spinner from the same packagelive demo · try it out
content underneath, dimmed by the overlay.
customize
variantspinner shape
sizespinner scale
toneaccent or inherited text color
labelannounced and shown as caption
blurbackdrop blur behind the scrim
usage
import { LoadingOverlay } from "@usva-ui/react/primitives/loading-overlay";
<div className="relative">
<LoadingOverlay label="Fetching courses" />
</div>props
| prop | type | default | notes |
|---|---|---|---|
| contain | "viewport" | "parent" | "parent" | parent covers the nearest positioned ancestor and locks nothing. viewport locks body scroll, refcounted, and restores the exact overflow value it found. |
| label | string | "Loading" | announced by the status region and repeated as a visible caption. |
| blur | boolean | true | backdrop blur behind the scrim. |
| variant | "ring" | "dots" | "bars" | "orbit" | "ring" | forwarded to Spinner. |
| size | SpinnerSize | "lg" | forwarded to Spinner. |
| tone | SpinnerTone | "accent" | forwarded to Spinner. |
get it
bun add @usva-ui/reactusage
import { LoadingOverlay } from "@usva-ui/react/primitives/loading-overlay";
<div className="relative">
<LoadingOverlay label="Fetching courses" />
</div>
<LoadingOverlay contain="viewport" label="Loading dashboard" />