<zg-load-mask>

The <zg-load-mask> tag is a web component that controls the styling and display of the load mask of the grid. <zg-load-mask> is used to define the loading overlay that displays on top of the grid before the grid is completely rendered. You can style the <zg-load-mask> through CSS variables or the zg-load-mask CSS selector.

Image of the DOM relationship for the zg-load-mask web component tag

Related Web Components

Usage

A <zg-load-mask> tag can be manually inserted inside the grid as slotted content or automatically inserted when the caption is enabled via the src attribute. The load mask is styleable via CSS variables or the zg-load-mask CSS selector.

The load mask inserted as slotted content will look like:

<zing-grid src="https://cdn.zinggrid.com/datasets/user-roles.json">
  <zg-load-mask>Hello World Loading...</zg-load-mask>
</zing-grid>

The load mask when triggered by the src attribute will look like:

<zing-grid src="https://cdn.zinggrid.com/datasets/user-roles.json"></zing-grid>

Attributes

There are no attributes available for the <zg-load-mask> web component.

CSS Variables

<zg-load-mask> can be styled with CSS variables, like so:

root: {
  --zg-load-mask-color: red;
}

Below is a list of all the associated --zg-load-mask CSS variables. Check out the full list of CSS variables or our Styling Basics guide to learn more about styling the grid.

ZGLoadMask CSS Variables and Default Values
NameDefaultDescriptionDemoCSS Ref
--zg-load-mask-color#fffSets the font color of the loading text

CSS Selector

<zg-load-mask> can be styled by common CSS selectors, like so:

zg-load-mask {
  background: red;
}