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(orloadingLabelwhile loading) is announced. - In the
cancelablestate the spinner holds a native button labelled bycancelLabel(Enter/Space activate it). - It blocks pointer input to the page; it does not trap keyboard focus.
API
ScreenSpinner
| Prop | Type | Default | Description |
|---|---|---|---|
| cancelLabel | string | Cancel | Accessible name of the cancel button in the `cancelable` state. |
| className | string | — | |
| customIcon | ReactNode | — | Icon for the `custom` state. |
| label | ReactNode | — | Visible text under the icon, announced on change. |
| loadingLabel | string | Loading… | Announced while loading when there is no `label`. |
| mode | "shadow" | "overlay" | shadow | `shadow` shows a floating card; `overlay` dims the whole screen. |
| noAnimation | boolean | false | |
| onCancel | (() => void) | — | |
| portal | boolean | true | Render into the portal layer. |
| state | ScreenSpinnerState | loading | |
| visibilityDelay | number | — | 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.
| Prop | Type | Default | Description |
|---|---|---|---|
| cancelLabel | string | Cancel | Accessible name of the cancel button in the `cancelable` state. |
| className | string | — | |
| customIcon | ReactNode | — | Icon for the `custom` state. |
| label | ReactNode | — | Visible text under the icon, announced on change. |
| loadingLabel | string | Loading… | Announced while loading when there is no `label`. |
| mode | "shadow" | "overlay" | shadow | `shadow` shows a floating card; `overlay` dims the whole screen. |
| noAnimation | boolean | false | |
| onCancel | (() => void) | — | |
| state | ScreenSpinnerState | loading |