Loading Overlay
Covers a region while it loads: the content stays in place, dimmed and blocked, with a spinner and an announced label.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
loading | boolean | false | Covers the content and blocks it. |
label | string | — | What is announced when loading starts. Defaults to the label slot's text, then the translatable "Loading". |
Slots
| Name | Description |
|---|---|
(default) | The region to cover. |
indicator | Replaces the spinner. |
label | Text under the spinner, e.g. "Saving changes…". Also what is announced. |
CSS parts
Shadow DOM styling hooks used with ::part(name). Prefer CSS custom properties when they cover the change.
| Name | Description |
|---|---|
scrim | The layer covering the content. |
indicator | Container of the spinner (or the indicator slot) and the label. |
label | Container of the label slot; hidden while it is empty. |
CSS custom properties
Grouped by semantic target and state from --c2-<component>__<target>__<state>--<property>. Click a group to collapse it; click a name to copy it.
| Name | Type | Default | Description |
|---|---|---|---|
--c2-loading-overlay--border-radius | border-radius | inherit | Rounds the scrim to match the region; it follows the host's own radius by default. |
--c2-loading-overlay--z-index | number | 10 | Stacking of the overlay above the content. |
--c2-loading-overlay--delay | time | 0ms | Wait before the overlay shows and is announced, e.g. 300ms so quick loads go unnoticed. |
--c2-loading-overlay--transition-duration | time | 150ms | Fade in and out. |
--c2-loading-overlay__scrim--background-color | color | #ffffff | Colour of the scrim; follows the surface in dark mode. |
--c2-loading-overlay__scrim--opacity | opacity | 0.72 | How much of the content the scrim hides. |
--c2-loading-overlay__scrim--blur | pixel | 1px | Blur of the content under the scrim; 0px for none. |
--c2-loading-overlay__spinner--size | pixel | 32px | |
--c2-loading-overlay__spinner--color | color | #0265dc | |
--c2-loading-overlay__indicator--gap | pixel | 12px | Space between the spinner and the label. |
--c2-loading-overlay__label--color | color | #18181b | |
--c2-loading-overlay__label--font-size | font-size | 14px | |
--c2-loading-overlay__label--font-weight | font-weight | 500 | |
Text and languages
The text the component shows, in English. It shows another language when the app adds one with addTranslations, under loading-overlay, and the nearest lang asks for it; any message not translated stays in English. {0}, {1}… stand for the values a message carries. Languages guide.
| Key | English | Values |
|---|---|---|
label | Loading | — |