LoadingVeil

LoadingVeil

HkLoadingVeil is the blocking wait: a dimmed, blurred backdrop over the whole viewport with a spinner and one line of text in the middle, swallowing every pointer event until the work finishes.

  • A spinner inside a list, a card or a form field is an HkSpinner — the rest of the surface stays usable, which is the right behaviour for a partial reload.
  • A wait that needs an answer, a cancel button or a focus trap is a dialog; the veil owns none of that.
  • Work with a measurable fraction reads better as an HkProgressBar or HkProgressRing than as an unqualified spinner.

Import

tsx
1
import { HkLoadingVeil } from "@celestia-island/hikari";
rust
1
2
use hikari_components::*;          // LoadingVeil
use hikari_components::prelude::*; // rsx!, VNode

Paint and block

active is the whole control: while it is true the veil paints above everything, including the toast band, and swallows all pointer events — no double taps, no scrolling, no interaction with anything beneath. When it turns false the veil leaves the tree. Keep it active only for the span of one user-facing operation: a veil that outlives its request turns the page into a locked window.

Opening the workspace

The label

label is the one line under the spinner, already localized by the caller. Naming the operation — "Signing in", "Preparing the export" — is what separates a wait that looks purposeful from one that looks stuck. With no label the veil still carries an accessible name ("loading"), so it remains announceable, but nothing on screen explains what is happening.

Signing in

Accessibility

  • The root is a status live region with aria-live="polite", so the label is announced when the veil appears — the spinner itself is aria-hidden.
  • The veil is not a modal: it does not trap focus, does not lock scrolling and does not close on Escape. Anything that must not be reachable while the wait runs has to be disabled or removed by the caller; the veil only blocks the pointer.
  • Keep the label short and specific. It is the only thing a screen-reader user hears about the wait.
  • Announce the end of the work somewhere else — clearing the veil is what tells sighted users, but the label leaving the tree is the only event an assistive-technology user gets from this component.

API

Vue

Props

NameTypeDefaultRequired
activeBooleanfalse—
labelString""—

Rust

Props — LoadingVeil

PropTypeDefaultDescription
activeboolfalsePaint + block while true.
labelString""One-line label under the spinner (already localized by the caller).

Related components

  • HkSpinner — the non-blocking indicator for a region.
  • HkProgressBar — a wait that can say how far along it is.
  • HkSkeleton — placeholder shapes when the layout is known ahead of the data.
  • HkEmptyState — what the surface shows when the load completes empty.
  • HkModal — a dialog that really does own focus and Escape.