Skip to content

Feedback

LoadingOverlay

Blocks interaction and shows a spinner over content.

import { LoadingOverlay } from '@var-ui/react';

LoadingOverlay

Blocks pointer interaction over its children while async work runs and shows a spinner. Toggle with visible; set label for the spinner’s accessible name.

Examples

Default

A compact content box with the overlay on.

Content behind overlay
Loading
Demo.tsxTSX
import { LoadingOverlay } from '@var-ui/react';

<LoadingOverlay visible label="Loading">
  <div style={{ width: '12.5rem', height: '5rem' }}>Content</div>
</LoadingOverlay>

Visible overlay

Pass visible over a bordered content surface so the backdrop and spinner cover the region being loaded.

Account settings

Display name, email, and notification preferences.

Saving changes
Demo.tsxTSX
import { LoadingOverlay } from '@var-ui/react';

<LoadingOverlay visible label="Saving changes">
  <div style={{ width: '17.5rem', minHeight: '7.5rem', padding: '1rem' }}>
    <strong>Account settings</strong>
    <p>Display name, email, and notification preferences.</p>
  </div>
</LoadingOverlay>

Props

Accessibility

When visible, the root sets aria-busy="true", the children are wrapped in an inert element (no focus, clicks or assistive-tech access while loading), and the spinner uses label (default "Loading"). Keep meaningful content as children so the blocked region remains in the document.