Axon 911 Frontend DocsAxon 911 Frontend Docs
Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Primitives
  2. Portal
  3. API and Development

Portal

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Import Portal from @prepared911/ui/portal.
Portal
PropTypeDescription
childrenReactNodeContent portaled into the owner document
elementElement | nullTrigger or anchor whose owner document receives the portal; optional when container is set
containerElement | nullMount node; defaults to the owner document body. Resolves the document when element is omitted
Server render and missing anchor: renders nothing. Re-targets when element or container changes.
Props
NameTypeDefaultDescription
childrenReactNode—Content rendered into the owner document mount node.
containerElement | null—Mount node. Defaults to the container of the nearest OverlayContainerProvider, then to the owner document's body. A container passed here wins over the provider's; null counts as not passed. Also resolves the document when element is omitted.
elementElement | null—Trigger or anchor whose owner document receives the portal; optional when container is set.
Storybook
Interactive examples and edge cases for this component are in Storybook.
DefaultOpens in a new tab
Previous
Portal / Usage
Next
Portal / Accessibility
On this page
Portal
Props
Storybook