zg-search

The <zg-search> tag is a web component that is used to encapsulate the interface component necessary to search the grid. The element is added dynamically when search is specified and should not be directly inserted by the user. The search is stylable via CSS variables or the zg-search CSS selector.

Image of the DOM relationship for the zg-search web component tag

Related Web Components

Usage

A <zg-search> tag can be triggered by adding the search attribute on the <zing-grid> tag.

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

Attributes

There are no attributes variables available for the <zg-search> web component.

CSS Variables

All the associated --zg-search CSS variables. You can find the full list of css variables or check out our styling basics to learn more about styling the grid.

root: {
  --zg-search-background: red;
}
ZGSearch CSS Variables and Default Values
NameDefaultDescriptionDemoCSS Ref
--zg-search-backgroundBrowser's default valueStyles the background of search input field
--zg-search-border0Styles the border of search input field
--zg-search-border-bottomvar(--zg-search-border, 0)Styles the bottom border of search input field
--zg-search-border-leftvar(--zg-search-border, 0)Styles the left border of search input field
--zg-search-border-radius0Applies border radius to search input field
--zg-search-border-rightvar(--zg-search-border, 0)Styles the right border of search input field
--zg-search-border-topvar(--zg-search-border, 0)Styles the top border of search input field
--zg-search-colorvar(--theme-color_alt)Sets the font color of search input field
--zg-search-font-sizevdSets the font size of search input field
--zg-search-font-weightvar(--theme-font-weight)Sets the font weight of search input field
--zg-search-height32pxSets the height of search input field
--zg-search-padding0 10px 0 15pxSets the padding of search input field
--zg-search-top50%Sets the position from the top to place search input field
--zg-search-transformtranslateY(-50%)Sets the transform property of search input

CSS Selector

<zg-search> can be styled by common CSS selectors.

zg-search {
  background: red;
}