# UI primitives This directory owns the app's interactive primitives. Three invariants govern what lives here and how new UI gets built. ## I1 — Stacking Every floating menu, popover, and suggestion surface portals to `document.body` through ``. Inline `absolute z-N` for floating UI is a bug — the surrounding element's `transform`, `filter`, or `backdrop-filter` will eventually trap it. The only legitimate bracketed z-layers are: | Layer | Value | File | | ------------------------------- | --------- | --------------------------------------------------------------------------- | | Mobile drawer | `z-[80]` | `ui/mobile-drawer.tsx` | | Dialog backdrop / search dialog | `z-[90]` | `ui/dialog.tsx`, `sidebar/search-dialog.tsx` | | Toast | `z-[100]` | `toast.tsx` | | Skip-link on focus | `z-[200]` | `workspace/layout.tsx`, `share/layout.tsx`, `layouts/standalone-layout.tsx` | Sub-stacking inside dialog/drawer/canvas surfaces uses small `z-10`/`z-30`/`z-40` and is OK — those are page-region surfaces, not menus. If you find yourself writing `className="… absolute z-N"` for a menu, stop — use ``. ## I2 — Action surface Every interactive _action_ renders through `