Skip to content

react-component/portal

Repository files navigation

@rc-component/portal

Ant Design Part of the Ant Design ecosystem.

🌀 React portal primitive with lifecycle-friendly container handling.

NPM version npm downloads build status Codecov bundle size dumi

English | 简体中文

Highlights

Area Support
Purpose React portal primitive with lifecycle-friendly container handling.
Package @rc-component/portal
Release @rc-component/np / rc-np

Install

npm install @rc-component/portal

Usage

import Portal from '@rc-component/portal';

export default () => <Portal open>Hello World</Portal>;

API

Prop Description Type Default
getContainer Customize portal container. Element | () => Element | string | false document.body
open Whether to render portal content. boolean false
autoLock Lock page scroll when the portal is open. boolean false

Development

npm install
npm start
npm test
npm run lint
npm run tsc
npm run compile

The dumi site runs at http://localhost:8000.

Release

npm run prepublishOnly

The release flow is handled by @rc-component/np through the rc-np command when the package uses the shared release flow.

License

@rc-component/portal is released under the MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

27 stars

Watchers

3 watching

Forks

Packages

 
 
 

Contributors