<zg-selector-mask>

Interactive Storybook Playground

The <zg-selector-mask> tag is a web component that is used to wrap the cells during user selection for styling purposes. The element should not be manually inserted by the user. The selector mask is styleable via CSS variables or the zg-selector-mask CSS selector.

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

Related Web Components

Usage

A <zg-selector-mask> tag can be triggered by adding the selector attribute on the <zing-grid> tag, like so:

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

Attributes

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

Top

CSS Variables

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

:root {
  --zg-selector-mask-background: red;
}

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

ZGSelectorMask CSS Variables and Default Values
Name Default Description Demo CSS Ref
--zg-selector-mask-background var(--theme-color-secondary) Styles the background of selector mask
--zg-selector-mask-opacity .1 Sets the opacity of selector mask
Top

CSS Selector

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

zg-selector-mask {
  background: red;
}
Top

CSS Shadow Parts

<zg-selector-mask> exposed elements within the shadow can be styled by CSS shadow parts, like so:

zg-selector-mask::part(selector-mask) {
  background-color: red;
}

Below is a list of all the associated ZGSelectorMask shadow parts. Check out the full list of CSS shadow parts or our Styling Basics guide to learn more about styling the grid.

ZGSelectorMask CSS Shadow Parts
Name Description
selector-mask The container for the selector mask
Top

Slots

There are no slots available for the <zg-selector-mask> web component.

Top

[api: <zg-selector-mask>]