5.32.0 • Published 6d ago
@cleartrip/ct-design-portal
Licence
ISC
Version
5.32.0
Deps
1
Size
29 kB
Vulns
0
Weekly
0
Portal
A component that renders its children in a different DOM node.
Installation
npm install @cleartrip/ct-design-portal
# or
pnpm add @cleartrip/ct-design-portal
Peer dependencies
# Required for all targets
npm install react
# Web only
npm install react-dom
# React Native only
npm install react-native
Usage
Basic
import { Portal } from '@cleartrip/ct-design-portal';
function Example() {
return (
<Portal>
{/* Basic usage */}
</Portal>
);
}
Props
| Prop | Type | Default | Required | Description |
|---|---|---|---|---|
children |
ReactNode |
— | Yes | The content to be rendered inside the portal. |
id |
string |
— | Yes | Unique identifier for the portal instance. On native, this is used by the |
Accessibility
- The component follows accessibility best practices
- Ensure proper ARIA attributes are provided where needed
- Test with screen readers to ensure usability
Migration
If migrating from a previous version:
- import { Portal } from 'yagami/core/components';
+ import { Portal } from '@cleartrip/ct-design-portal';