Portal
Render children at the root, above navigation. The primitive behind every overlay.


npx @eoria/cli add portalUsage
import { Portal, PortalHost } from '@/components/ui/portal'
// once, last in the root layout<PortalHost />
// anywhere<Portal modal>{overlay}</Portal>Notes
- A module store plus
useSyncExternalStore, no native Modal. Same behaviour on every platform, and it never fights the navigator. modalmarks the hostaccessibilityViewIsModalwhile mounted, which hides the rest of the app from VoiceOver.- React context does not cross the portal. Components that need it re-provide it inside their portal content. Dialog, Popover, DropdownMenu and Select all do.
- The host measures its own window offset so anchored content can convert
measureInWindowcoordinates. It always mounts, withpointerEvents="box-none", so it never blocks touches.