Skip to content

Z-Index

The Six Webcomponents library uses a set of z-index tokens to manage stacking context throughout the interface.

CSS VariableValueUsage
--six-z-index-header500Used for header elements
--six-z-index-search-field500Used for search field components
--six-z-index-drawer600Used for drawer/sidebar components
--six-z-index-dropdown700Used for dropdown menus
--six-z-index-toast800Used for toast notifications
--six-z-index-tooltip900Used for tooltips
--six-z-index-dialog1000Used for modal dialogs

Interactive Example

Hover over the box below to see how z-index affects stacking order:

Header Element
z-index: 500
Hover Me!
z-index: 400 → 600

In this example, the red box starts with a lower z-index (400) than the blue box (500). When you hover over the container, the red box's z-index increases to 600, causing it to appear above the blue box.

Example Usage

css
.header {
  z-index: var(--six-z-index-header); /* 500 */
}

.tooltip {
  z-index: var(--six-z-index-tooltip); /* 900 */
}

/* Dropdown menu that appears above the header */
.dropdown-menu {
  position: absolute;
  z-index: var(--six-z-index-dropdown); /* 700 */
  /* This ensures the dropdown appears above the header (500) */
}