Skip to content

Portal

Free

Renders its children at the end of the page body or in an element you pick, so a clipped or turned parent does not trap them.

  • Base UI
  • React 19
  • Tailwind CSS 4

Added Nov 8, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Wrap content that must leave its parent. Place the content with its own classes.

saved-notice.tsx

Portal

<div>
PropTypeDefaultDescription
containerHTMLElement | null—Where the content renders. null or no value: document.body.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Use it when a parent with overflow: hidden, a transform, or a filter cuts or moves a fixed child.
  • Set container to render in an element other than the page body.
  • Place the content with its own classes (fixed end-6 bottom-6 z-50). The Portal sets no place and no z-index.
  • For a popup that opens from a trigger, the popup part has its own portal. Use a Popover.
  • For a modal window with a focus trap, use a Dialog.

The content moves to the end of the page in the DOM, so it comes last in the Tab order. Content that people must reach at once needs its own focus move.

  1. AddedPortal.
Open the release