Skip to content

Z-index

Pando uses a named map of values to provide consistent and predictable layering of elements along the z-axis based on the element’s purpose.

Token Usage

// import { css } from '@/styled-system/css'
<div class={css({ zIndex: 'base' })}>base z-index</div>

Example

Modify the divs with the z-index tokens see how the z-index values affect the layering of the elements.

Map

Pando reserves the 1000-1999 range, plus 50 for non-important style values (borders, etc.). This gives your product the freedom to use the 100-999 range.

In the panda-preset package, we use a structured layering map to organize our z-index values. Here is the map we use for our API:

TokenValueDescription
hide-1Used for when you need to hide elements in the layer stack
base0Initial layer value
decorator50Used for positioning pseudo-elements, borders, and other similar elements in the layer stack
dropdown1000Used for positioning any dropdown like elements in the layer stack
sticky1200Used for positioning elements that need to stick to their nearest scrolling ancestor in the layer stack
banner1300Used for positioning any elements that are used like a admonition in the layer stack
overlay1400Used for positioning overlay elements in the layer stack
modal1500Used for positioning modal elements in the layer stack
popover1600Used for positioning popover elements in the layer stack
toast1700Used for positioning toast elements in the layer stack
tooltip1800Used for positioning tooltip elements in the layer stack