Docs Version 1

<zg-sort-menu>

Interactive Storybook Playground

The <zg-sort-menu> tag is the container for the menu that appears when clicking on the control bar's sort button. It is used as a CSS target for styling by the developer. The <zg-sort-menu> web component should not be accessed specifically beyond styling.

Image of the DOM relationship for the zg-sort-menu web component tag

Related Web Components

Usage

The <zg-sort-menu> element is a generated element added to <zing-grid> when the sort attribute is defined and the grid is set to layout="card". In row layout, sorting is handled directly from the column headers, so the sort menu is not used.

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

Attributes

There are no attributes available for the <zg-sort-menu> web component.

Top

CSS Variables

<zg-sort-menu> can be styled with CSS variables, like so:

:root {
--zg-sort-menu-background: red;
}

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

ZGSortMenu CSS Variables and Default Values
Name Default Description Demo CSS Ref
Top

CSS Shadow Parts

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

zg-sort-menu::part(sort-menu) {
  background-color: red;
}

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

ZGSortMenu CSS Shadow Parts
Name Description
Top

Slots

There are no slots available for the <zg-sort-menu> web component.

Top

[api: <zg-sort-menu>]