Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

boundless-portal

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boundless-portal

A higher-order component for the rendering of components outside the normal React tree.

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
88
46.67%
Maintainers
1
Weekly downloads
 
Created
Source

Portal

Portal is used in other components such as Popover to render content to places like the HTML <body> tag, avoiding style leakage and parent layout contexts. Only accepts a single top-level child; naked text, etc will be wrapped in a <div>.

Installation

npm i boundless-portal --save

Then use it like:

import Portal from 'boundless-portal';

Portal can also just be directly used from the main Boundless library. This is recommended when you're getting started to avoid maintaining the package versions of several components:

npm i boundless --save

the ES6 import statement then becomes like:

import { Portal } from 'boundless';

Props

Note: only top-level props are in the README, for the full list check out the website.

Required Props

There are no required props.

Optional Props

  • * · any React-supported attribute

    ExpectsDefault Value
    anyn/a
  • children · any normal React child, but must be singular; multiple sibling children must have a common wrapper, such as a "layout" <div>

    ✅ OK:

    <Portal>
      foo
    </Portal>
    
    <Portal>
      <div>foo</div>
    </Portal>
    
    <Portal>
      <div>
          <div>foo</div>
          <div>bar</div>
      </div>
    </Portal>
    

    ⛔️ Not OK:

    <Portal>
      <div>foo</div>
      <div>bar</div>
    </Portal>
    
    ExpectsDefault Value
    any renderablenull
  • destination · the location to append the generated portal and child elements

    ExpectsDefault Value
    HTMLElementdocument.body
  • portalId · the ID used to link the portal origin to the destination; added to generated <div> appended to the destination HTML node

    ExpectsDefault Value
    stringnull

Keywords

react

FAQs

Package last updated on 06 Jun 2017

Did you know?

Socket

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