# @acrool/react-portal

> Portal library based for Reactjs

Latest version **1.1.2** (published 2025-05-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @acrool/react-portal
pnpm add @acrool/react-portal
yarn add @acrool/react-portal
bun add @acrool/react-portal
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2025-05-01 |
| First published | 2024-07-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=14 |
| Dependencies | 0 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | info@acrool.com |
| Maintainers | imagine10255 |
| Keywords | acrool, react, typescript, portal |

## Links

- npm: https://www.npmjs.com/package/@acrool/react-portal
- Repository: https://github.com/acrool/acrool-react-portal
- Homepage: https://github.com/acrool/acrool-react-portal#readme
- Issues: https://github.com/acrool/acrool-react-portal/issues
- npm.io page: https://npm.io/package/@acrool/react-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

- 1.1.2 (latest) — 2025-05-01
- 1.0.4-alpha.1 (alpha) — 2025-04-21
- 1.1.2-test.0 — 2025-05-01
- 1.1.1 — 2025-04-26
- 1.1.0 — 2025-04-21
- 1.0.4-alpha.0 — 2025-03-03
- 1.0.3 — 2024-09-14
- 1.0.2 — 2024-09-09
- 1.0.2-alpha.1 — 2024-09-09
- 1.0.2-alpha.0 — 2024-09-09
- 1.0.1 — 2024-07-28
- 1.0.0 — 2024-07-25
- 0.0.6-alpha.1 — 2024-07-25
- 0.0.6-alpha.0 — 2024-07-25
- 0.0.5 — 2024-07-25
- … 9 more at https://npm.io/package/@acrool/react-portal/versions

## README

# Acrool React Portal

<a href="https://acrool-react-portal.pages.dev/" title="Acrool React Portal - Throw React elements (ex: modal, dialog, toaster) to external using elements (usually used for">
    <img src="https://raw.githubusercontent.com/acrool/acrool-react-portal/main/example/public/og.png" alt="Acrool React Portal Logo"/>
</a>


<p align="center">
    Throw React elements (ex: modal, dialog, toaster) to external using elements (usually used for
</p>

<div align="center">

[![NPM](https://img.shields.io/npm/v/@acrool/react-portal.svg?style=for-the-badge)](https://www.npmjs.com/package/@acrool/react-portal)
[![npm](https://img.shields.io/bundlejs/size/@acrool/react-portal?style=for-the-badge)](https://github.com/acrool/@acrool/react-portal/blob/main/LICENSE)
[![npm](https://img.shields.io/npm/l/@acrool/react-portal?style=for-the-badge)](https://github.com/acrool/react-portal/blob/main/LICENSE)

[![npm downloads](https://img.shields.io/npm/dm/@acrool/react-portal.svg?style=for-the-badge)](https://www.npmjs.com/package/@acrool/react-portal)
[![npm](https://img.shields.io/npm/dt/@acrool/react-portal.svg?style=for-the-badge)](https://www.npmjs.com/package/@acrool/react-portal)

</div>

https://react.dev/reference/react-dom/createPortal

`^1.1.0 support react >=18.0.0 <20.0.0`

## Features

- Pass the component to the external Dom through the portal

## Install

```bash
yarn add @acrool/react-portal
```

## Usage

add in your App.tsx

```tsx
import ReactPortal from '@acrool/react-portal';

const App = () => {
    return (
        <ReactPortal
            id="acrool-react-modal"
            className={styles.root}
        >
            {item && renderDialog()}
        </ReactPortal>
    );
};
```


There is also a example that you can play with it:

[![Play react-editext-example](https://raw.githubusercontent.com/acrool/acrool-react-dialog/main/play-in-example-button.svg)](https://acrool-react-dialog.pages.dev)

[![Play react-editext-example](https://raw.githubusercontent.com/acrool/acrool-react-dialog/main/play-in-example-button.svg)](https://acrool-react-modal.pages.dev)

[![Play react-editext-example](https://raw.githubusercontent.com/acrool/acrool-react-toaster/main/play-in-example-button.svg)](https://acrool-react-toaster.pages.dev)


## With application

- [Acrool React Dialog](https://github.com/acrool/acrool-react-dialog)
- [Acrool React Toaster](https://github.com/acrool/acrool-react-toaster)
- [Acrool React Picker](https://github.com/acrool/acrool-react-picker)

## License

MIT © [Acrool](https://github.com/acrool) & [Imagine](https://github.com/imagine10255)

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