File: portal.md | Updated: 11/15/2025
ThemesThemes PrimitivesPrimitives IconsIcons ColorsColors
Documentation Case studies Blog
Search
/
Introduction Getting started Accessibility Releases
Styling Animation Composition Server-side rendering
Accordion
Alert Dialog
Aspect Ratio
Avatar
Checkbox
Collapsible
Context Menu
Dialog
Dropdown Menu
Form
Preview
Hover Card
Label
Menubar
Navigation Menu
One-Time Password Field
Preview
Password Toggle Field
Preview
Popover
Progress
Radio Group
Scroll Area
Select
Separator
Slider
Switch
Tabs
Toast
Toggle
Toggle Group
Toolbar
Tooltip
Accessible Icon Direction Provider Portal Slot Visually Hidden
Utilities
Renders a React subtree in a different part of the DOM.
Render any React subtree outside of your App.
Appends to `document.body` by default but can be customized to use a different container.
Install the component from your command line.
npm install @radix-ui/react-portal
Import the component.
import { Portal } from "radix-ui";
export default () => <Portal.Root />;
Use the portal primitive.
import { Portal } from "radix-ui";
export default () => <Portal.Root>Content</Portal.Root>;
Anything you put inside this component will be rendered in a separate <div> element. By default, this element will be appended to document.body but you can choose a different container by using the container prop.
| Prop | Type | Default |
| --- | --- | --- |
| asChild<br><br>Prop description | boolean | false |
| container<br><br>Prop description | HTMLElement | No default value |
PreviousDirection Provider
NextSlot