https://github.com/acrool/acrool-react-portal
Throw React elements (ex: modal, dialog, toaster) to external using elements (usually used for
https://github.com/acrool/acrool-react-portal
Last synced: 2 months ago
JSON representation
Throw React elements (ex: modal, dialog, toaster) to external using elements (usually used for
- Host: GitHub
- URL: https://github.com/acrool/acrool-react-portal
- Owner: acrool
- Created: 2024-07-14T00:58:21.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-03-03T15:05:54.000Z (4 months ago)
- Last Synced: 2025-03-26T19:03:09.073Z (3 months ago)
- Language: MDX
- Size: 1.03 MB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-react - Acrool React Portal - React Component portal out dom (ex: Modal, Tooltips, Dropdown) (React underlying structure)
- awesome-react - Acrool React Portal - React Component portal out dom (ex: Modal, Tooltips, Dropdown) (React underlying structure)
README
# Acrool React Portal
Throw React elements (ex: modal, dialog, toaster) to external using elements (usually used for[](https://www.npmjs.com/package/@acrool/react-portal)
[](https://github.com/acrool/@acrool/react-portal/blob/main/LICENSE)
[](https://github.com/acrool/react-portal/blob/main/LICENSE)[](https://www.npmjs.com/package/@acrool/react-portal)
[](https://www.npmjs.com/package/@acrool/react-portal)https://react.dev/reference/react-dom/createPortal
## 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 (
{item && renderDialog()}
);
};
```There is also a example that you can play with it:
[](https://acrool-react-dialog.pages.dev)
[](https://acrool-react-modal.pages.dev)
[](https://acrool-react-toaster.pages.dev)
## License
MIT © [Acrool](https://github.com/acrool) & [Imagine](https://github.com/imagine10255)