-
Notifications
You must be signed in to change notification settings - Fork 127
Add Portal component #3107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add Portal component #3107
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
andrewzamojc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just curious about the positioning props on the portal.
| let { | ||
| anchor, | ||
| open = true, | ||
| position = 'bottom', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this mixing concepts between portal and overlay? I haven't gone this deep on portals but I didn't think they had a position like a popover...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is a positioned portal. We could consider having just a portal component and then handling the positioning separately, but I figured for 99% of our use cases we're going to want to position it.
In my experience an overlay wouldn't need to be positioned since it's usually the same (centered) in every instance. Is that not your experience? Curious if you have any more insights into patterns for portals you've seen and liked!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya I see. Basically this is practical and always how we're going to use it 👍
|
This is great stuff! Pretty cool to see the guts of a Portal. |
andrewzamojc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description & motivation 💭
This PR introduces a new
Portalcomponent to the Holocene design system and integrates it with the existingMenucomponent via an opt-inusePortalprop.Portalrenders children at a specific position relative to an anchor element with advanced positioning features:document.bodyto escape overflow/z-index constraintstop,bottom,left,right,top-left,top-right,bottom-left,bottom-right)flipOnCollisionis enabledscrollContainerprophideWhenAnchorHiddenis enabledScreenshots (if applicable) 📸
Design Considerations 🎨
Testing 🧪
How was this tested 👻
Steps for others to test: 🚶🏽♂️🚶🏽♀️
Checklists
Draft Checklist
Merge Checklist
Issue(s) closed
Related to
DT-3325Docs
Any docs updates needed?