Layering
Components: Drawer, Dialog, DropdownMenu, Select, Popover, HoverCard, Calendar, FilterCascade
+8 more
Tooltip, Toaster, SearchModal, Tour, SelectionBulkBar, TableActionBar, FeedbackPulse, PageHeader
Overlays stack themselves by nesting depth. App code never sets z-index on a design-system overlay.
What you use
What does not exist:
- No z-index token scale and no
z-overlay,z-modal,z-popoverorz-toastutility. - No
zIndexprop on any overlay. - No
portal={false}or container prop onDrawer,Dialog,DropdownMenu,Select,PopoverorTooltip. - No
Overlayexport. The backdrop comes fromDrawerandDialogwhenoverlayistrue. - No
Dialogin the package root. Import it from@wallarm-org/design-system/Dialog.
Rules
- If an overlay opens from inside another overlay, render it as a React child of the parent's content. Depth comes from the React tree.
- If you open a
Dialogfrom aDrawer, put theDialoginsideDrawerContent. Only a React-ancestor drawer or dialog dismisses the nested one. - If you nest a
Drawerin aDrawer, or aDialogin aDialog, expect the parent to scale back. ADialogover aDrawerdoes not scale the drawer. - If a dropdown, select, popover, calendar or tooltip sits in any overlay, use it as-is. It already paints above its host.
- If your app has its own fixed element (chat widget), keep its z-index below 40. At 40 or higher it paints over the drawer backdrop.
- If your app has its own sticky element inside a scroll area, use
z-10. - Never add a
z-*class orstyle={{ zIndex }}toDrawerContent,DropdownMenuContent,SelectPositioner,PopoverContent,HoverCardContent,CalendarContentorTooltipContent. - If chrome you can't change (a framework or docs-site header) sits at z-index 40 or higher, raise
--drawer-overlay-z-indexand--drawer-positioner-z-indextogether on:rootabove it, positioner 10 higher. Keep both under 900. - Never override
--tooltip-z-indexor--toast-z-index, and never change only one of the two drawer variables. - Never wrap an overlay trigger in
transform,filterorisolation: isolateto fix stacking. Overlay content is portaled todocument.body. - Never open
SearchModalfrom inside aDrawerorDialog. The backdrops cover the search box. - Never start a
Tourwhile aDrawerorDialogis open. The drawer ties with or covers the tour. - Never show
TableActionBarfor a table inside aDrawerorDialog. The drawer ties with or covers the bar.
Examples
A menu inside a drawer paints above the drawer with no z-index class.
A confirm dialog opened from a drawer is a React child of DrawerContent.
An app-owned floating widget stays below the drawer backdrop.
Reference
Depth-based overlays
Drawer, Dialog, DropdownMenu, Select, Popover, HoverCard, Calendar and FilterCascade. Each level adds 20.
Fixed overlays
Variables
In-flow values
In-component only; never competes with overlays.