mui / mui/base-ui

[docs] How to use @base-ui-components/react in complex projects

Open
#2,916 2 comments 0 reactions 0 assignees View on GitHub
docs support: question
Dominant language
TypeScript
Stars
10.9k
Forks
543
Avg merge
1d 20h
Merged PRs (30d)
101

Description

I have some questions about how to use @base-ui-components/react, and I’d like to get some clarification:
1. How should I use @base-ui-components/react in a more complex project?
Since the components provided by @base-ui-components/react come unstyled, I need to implement the styles myself. But how can I attach a default style to the components I need?
• Do I have to export, copy, and paste my CSS files, or maintain some global CSS files and reference them whenever I use the components?
• Or should I wrap the existing components to create new ones with default styles? If I do that, then when using components, some will come from the @base-ui-components/react namespace and some won’t, which feels a bit strange. Does that mean I should wrap every single component provided by @base-ui-components/react?

2. I’m currently using @mui/material, and the reason I want to try @base-ui-components/react is mainly because I need a component library that has good support for nested menus. How can I conveniently apply the @mui/material theme to components provided by @base-ui-components/react/Menu?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.