Skip to content
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

Add a Portal component #1524

Open
cpakken opened this issue Mar 2, 2025 · 5 comments
Open

Add a Portal component #1524

cpakken opened this issue Mar 2, 2025 · 5 comments
Labels
component: portal This is the name of the generic UI component, not the React module! new feature New feature or request waiting for 👍 Waiting for upvotes

Comments

@cpakken
Copy link

cpakken commented Mar 2, 2025

Feature request

Base-UI is internally using portals for components like

Please expose the as its own component

Similar to https://www.radix-ui.com/primitives/docs/utilities/portal

@cpakken cpakken added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Mar 2, 2025
@mj12albert mj12albert added new feature New feature or request component: portal This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Mar 3, 2025
@mj12albert mj12albert changed the title Simple Portal Component Add a Portal component Mar 3, 2025
@mj12albert
Copy link
Member

@cpakken Could you share some details about your use-case for using a portal directly?

As you said, all the components that could have a portal should already provide it

@mj12albert mj12albert added the waiting for 👍 Waiting for upvotes label Mar 3, 2025
@cpakken
Copy link
Author

cpakken commented Mar 3, 2025

I have a <ReaderView /> component that I want to maximize to the viewport by portaling out with fixed position. I can use React's native portal but I'd rather use BaseUI's underlying portal if I'm going to be using its other components. This way I don't need to create a separate portal dom node and just keep things consistent

@mj12albert
Copy link
Member

Actually the internal portals are just Floating UI's portal: https://github.com/mui/base-ui/blob/master/packages/react/src/select/portal/SelectPortal.tsx#L19

@colmtuite
Copy link
Contributor

@cpakken Do you need focus management for your use case? We have a lite Portal that we use internally that we could export, but it doesn't include focus management.

@cpakken
Copy link
Author

cpakken commented Mar 3, 2025

@colmtuite that would be nice, there are some control buttons in the <ReaderView />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: portal This is the name of the generic UI component, not the React module! new feature New feature or request waiting for 👍 Waiting for upvotes
Projects
None yet
Development

No branches or pull requests

3 participants