Portal

Renders children to a dedicated root outside the parent DOM tree. Used by every overlay primitive.

Foundation@sisyphos-ui/portalView on npmView as Markdown

Preview

tsx

Children below are rendered into a Portal attached to document.body. Open the element inspector to see them outside this section.

Installation

Install the individual package:

$ pnpm add @sisyphos-ui/portal @sisyphos-ui/core

Or use the umbrella package that bundles everything:

$ pnpm add @sisyphos-ui/ui

Usage

Import the component styles and the component itself:

snippet.tsxtsx
import "@sisyphos-ui/portal/styles.css";
import { Portal } from "@sisyphos-ui/portal";

API

Props table is being written. See the package README for the complete API surface.

The full API including refs, ARIA attributes, and HTML passthroughs lives in the package README.

Was this page helpful?
Edit this page on GitHub