Skip to content

Latest commit

 

History

History
71 lines (52 loc) · 2.79 KB

File metadata and controls

71 lines (52 loc) · 2.79 KB

@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.