Browse Foundations

Foundations

Overview

Layer (z-index) controls the stacking order of UI elements. It determines which components appear above or below others on the screen.

Principles

Global layer

Use global layers to keep navigation, modals, and notifications in a consistent order.

Local layer

Use local layers so dropdowns, tooltips, and popovers stay within their parent context.

Stacking order

Show layers from highest to lowest z-index. Users see the top of the stack first.

Globalstacking order across the entireapplication or pageLocalinside a parent container to managestacking within that containerglobal-layer-base (0)global-layer-raised (100)global-layer-floating (400)global-layer-overlay (800)global-layer-modal (1600)local-layer-raised (1700)local-layer-floating (2000)local-layer-overlay (2400)Main nav (2)ButtonToast (3)Megamenu/Dropdownmenu (2)Modal (4)PanelButtonCard (1)On hover (5)Card (1)On hover (5)PagebackgroundScrimOverflowmenu/Dropdownmenu (2)Icon buttonTooltip (3)Tooltip (3)Text inputSelect/Combobox/DatepickerRadio button/CheckboxButtonSelectmenu/Comboboxmenu/Datepickermenu (2)Text inputSelect/Combobox/DatepickerRadio button/CheckboxButtonSelectmenu/Comboboxmenu/Datepickermenu (2)FormForm
  • Components with elevation
  • Components without elevation
  • Scrim

What the number in brackets means

Some components in the diagram show a small number in brackets — like Toast (3) or Main nav (2). That number is the component's position inside its layer. Add it to the layer's base value to get the final z-index.

For example, Toast (3) lives in the overlay layer (base value 800), so its actual z-index is 800 + 3 = 803. Main nav (2) lives in the floating layer (base value 400) at 402 — so Toast sits well above the nav.

The layer scale

Layers are shown from highest to lowest z-index — the top of each stack is what your user sees first. The scale runs from base (0) through raised (100), floating (400), overlay (800), up to modal (1600).

Singapore Government Design System

The Singapore Government Design System was developed to empower teams in creating fast, accessible and mobile-friendly digital services.

Past VersionsSGDS v1SGDS v2