Getting Started

Z-Ordering

How Laioutr prevents z-index conflicts between sections and how to use z-index tokens for sticky or fixed elements.

You build a hero section with z-index: 10 on its navigation arrows. A content manager drags a product grid section below it. The arrows now paint over the grid. This is a z-index leak: values inside one section escape and break sibling sections. Laioutr prevents this with section isolation and a z-index token scale.

Section isolation

Every section gets its own CSS stacking context via isolation: isolate on the section root. Z-index values inside your section cannot leak out and affect neighboring sections.

Portaled content (reka-ui DropdownMenu, Sheet, Dialog, AlertDialog) is unaffected by section isolation because it renders outside your section's DOM tree via a portal to <body>.

The #__nuxt root

The Nuxt app root (#__nuxt) also receives isolation: isolate. This creates a stacking boundary between the app content and portaled elements at <body> level. Any portaled element with a positive z-index appears above the entire app.

How it fits together

Section z-index values (like the hero slider's z-index: 10) are trapped inside their section's stacking context. Portaled elements sit at <body> level with z-index values from the token scale, above the entire #__nuxt app.

Z-index tokens

Use the provided CSS custom properties instead of hardcoded z-index values:

TokenValueUse case
--z-index-sticky100Sticky headers, fixed filter bars
--z-index-modal1400Sheet, dialog, alert dialog (overlay and content)
--z-index-popover1500Dropdown menus, select menus, popovers
--z-index-tooltip1600Tooltips
--z-index-toast1700Toast notifications
.my-sticky-bar {
  position: sticky;
  top: 0;
  z-index: var(--z-index-sticky);
}

Why modals share one z-index

Modal overlays (backdrops) and modal content use the same --z-index-modal value. When multiple modals stack (e.g. an alert dialog on top of a sheet), DOM order determines which appears on top — later portals paint above earlier ones. A separate overlay z-index would cause the second modal's backdrop to slip behind the first modal's content.

Opting out of isolation

Sections with sticky or fixed positioning that must remain visible above subsequent sections need to opt out of isolation. Otherwise their z-index is trapped inside the section's stacking context and they disappear behind the next section as it scrolls past.

Set rendering: { isolate: false } in your section definition:

export const definition = defineSection({
  component: 'SectionStickyHeader',
  rendering: { isolate: false },
  studio: { label: 'Sticky Header', tags: ['Header'] },
});
Only disable isolation for sections with sticky or fixed elements that must remain visible above subsequent sections. Disabling it for regular sections reintroduces z-index conflicts between sections.
If a dropdown or popover inside your section appears behind another section, the overlay is likely not being portaled. All reka-ui overlay components portal to <body> by default. Verify that yours do, too.