# react-content-portal

> React component for transportation React elements at the end of the

Latest version **0.1.6** (published 2017-06-02) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install react-content-portal
pnpm add react-content-portal
yarn add react-content-portal
bun add react-content-portal
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.6 |
| Published | 2017-06-02 |
| First published | 2017-04-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Yakov Dalinchuk |
| Maintainers | pixd |
| Keywords | react-content-portal, content-portal, react-portal, portal, modal, stacking-context, react-component, react |

## Links

- npm: https://www.npmjs.com/package/react-content-portal
- Repository: https://github.com/pixd/react-content-portal
- Homepage: https://github.com/pixd/react-content-portal#readme
- Issues: https://github.com/pixd/react-content-portal/issues
- npm.io page: https://npm.io/package/react-content-portal

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.6 (latest) — 2017-06-02
- 0.1.0 — 2017-04-03

## README

```javascript
import React from 'react';
import ReactDOM from 'react-dom';

import Portal from 'react-content-portal';

const nodeFabric = () => document.createElement('section');
const node = document.createElement('section');

class App extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      portalIsOpen: false,
    };

    this.handleClick = this.handleClick.bind(this);
  }

  handleClick() {
    const { portalIsOpen } = this.state;
    this.setState({ portalIsOpen: ! portalIsOpen });
  }

  render() {
    const { portalIsOpen } = this.state;

    return (
      <div>
        <button onClick={this.handleClick}>Click me!</button>

        {portalIsOpen && (
          <Portal>
            <div>Base functionality example</div>
          </Portal>
        )}

        <Portal isContentMount={portalIsOpen}>
          <div>`isContentMount` attribute example</div>
        </Portal>

        <Portal portalName="portal-name">
          <div>`portalName` attribute example</div>
        </Portal>

        <Portal node="section">
          <div>`node` attribute example (tag name)</div>
        </Portal>

        <Portal node={nodeFabric}>
          <div>`node` attribute example (HTMLElement)</div>
        </Portal>

        <Portal node={node}>
          <div>`node` attribute example (HTMLElement fabric)</div>
        </Portal>

        <Portal className="some-class">
          <div>`className` attribute example</div>
        </Portal>

        <Portal zIndex="1">
          <div>`zIndex` attribute example</div>
        </Portal>
      </div>
    );
  }
}

ReactDOM.render(<App />, document.getElementById('root'));
```

---
_Source: https://npm.io/package/react-content-portal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
