Socket
Socket
Sign inDemoInstall

@radix-ui/react-portal

Package Overview
Dependencies
14
Maintainers
6
Versions
175
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @radix-ui/react-portal


Version published
Maintainers
6
Install size
347 kB
Created

Package description

What is @radix-ui/react-portal?

The @radix-ui/react-portal package is a React component library that allows you to render components in a different part of the DOM than their parent components. This is particularly useful for rendering modals, tooltips, and other floating elements that need to break out of the normal document flow to avoid issues with overflow, z-index, and CSS inheritance.

What are @radix-ui/react-portal's main functionalities?

Rendering children in a portal

This feature allows you to render a React component or any JSX outside of its parent component's DOM hierarchy. The code sample demonstrates how to use the Portal component to render a div element at the end of the document body.

{"import { Portal } from '@radix-ui/react-portal';\n\nconst MyComponent = () => (\n  <Portal>\n    <div>\n      This will be rendered outside the parent DOM hierarchy.\n    </div>\n  </Portal>\n);"}

Other packages similar to @radix-ui/react-portal

Readme

Source

react-portal

Installation

$ yarn add @radix-ui/react-portal
# or
$ npm install @radix-ui/react-portal

Usage

View docs here.

FAQs

Last updated on 25 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc