Capítulo 2 de 51
Installing Base UI is a single package add; the only mandatory app-shell setup is a root stacking-context style for portaled popups, plus an iOS 26+ Safari backdrop fix — everything else is assembling Root/Trigger/Portal/Positioner/Popup parts and styling them yourself.
pnpm add @base-ui/react (or npm i / yarn add / bun add) — one package, tree-shakable, so unused components don't ship.div.root with isolation: isolate so portaled content reliably renders above page content regardless of any z-index elsewhere.position: absolute instead of position: fixed; add body { position: relative; } globally so the absolute positioning covers the full visual viewport even after scroll.Root → Trigger → Portal → Positioner → Popup (+ Arrow, Title, Description for a Popover), styled with Tailwind classes off data-* attributes or CSS Modules targeting the same attributes — see ch005 (Styling).llms.txt index is linked from the Handbook nav section for feeding the full doc set to an AI assistant./* layout.tsx — required app-shell wrapper for portaled popups */
<body>
<div className="root">{children}</div>
</body>
/* styles.css — stacking context + iOS 26 Safari backdrop fix */
.root { isolation: isolate; }
body { position: relative; }
/* Minimal Popover assembly (Tailwind) */
import { Popover } from '@base-ui/react/popover';
<Popover.Root>
<Popover.Trigger className="...">Notifications</Popover.Trigger>
<Popover.Portal>
<Popover.Positioner sideOffset={8}>
<Popover.Popup className="...">
<Popover.Arrow className="..." />
<Popover.Title className="...">Notifications</Popover.Title>
<Popover.Description className="...">You are all caught up. Good job!</Popover.Description>
</Popover.Popup>
</Popover.Positioner>
</Popover.Portal>
</Popover.Root>
Root (state) → Trigger (opener) → Portal (DOM escape) → Positioner (placement) → Popup (visual surface), optionally with Arrow/Title/Description..root { isolation: isolate } + body { position: relative } styles once, globally, before building any popup component — skipping this causes stacking/backdrop bugs that are easy to misdiagnose later.data-*-attribute styling contract every component shares.data-* attribute convention referenced by every class name in the demo above.data-starting-style/data-ending-style used in the Popover demo's transition classes.