datui
Color scheme

Feedback

ScreenSpinner

Full-screen blocking loader that can turn into a done, error or custom icon, or offer cancel.

import { ScreenSpinner, ScreenSpinnerContainer } from "datui";

Examples

Inline container

ScreenSpinnerContainer renders the status card in place, without the full-screen layer.

Uploading
Uploaded
Failed

States

Loading, then cancelable, then done.

Accessibility

  • The card is a polite live region (role="status"); label (or loadingLabel while loading) is announced.
  • In the cancelable state the spinner holds a native button labelled by cancelLabel (Enter/Space activate it).
  • It blocks pointer input to the page; it does not trap keyboard focus.

API

ScreenSpinner

PropTypeDefaultDescription
cancelLabelstringCancelAccessible name of the cancel button in the `cancelable` state.
classNamestring—
customIconReactNode—Icon for the `custom` state.
labelReactNode—Visible text under the icon, announced on change.
loadingLabelstringLoading…Announced while loading when there is no `label`.
mode"shadow" | "overlay"shadow`shadow` shows a floating card; `overlay` dims the whole screen.
noAnimationbooleanfalse
onCancel(() => void)—
portalbooleantrueRender into the portal layer.
stateScreenSpinnerStateloading
visibilityDelaynumber—Wait this many ms before showing (input is blocked right away). Avoids flashes for quick loads.

ScreenSpinnerContainer

The status card of `ScreenSpinner` without the fixed full-screen layer, for custom placement.

PropTypeDefaultDescription
cancelLabelstringCancelAccessible name of the cancel button in the `cancelable` state.
classNamestring—
customIconReactNode—Icon for the `custom` state.
labelReactNode—Visible text under the icon, announced on change.
loadingLabelstringLoading…Announced while loading when there is no `label`.
mode"shadow" | "overlay"shadow`shadow` shows a floating card; `overlay` dims the whole screen.
noAnimationbooleanfalse
onCancel(() => void)—
stateScreenSpinnerStateloading