Agent skill Frontend
Using Base UI With Material UI
Build or refine reusable components for a web interface.
Install the skill
Run the command from your project root with Node.js and npm.
npx skills@latest add https://github.com/siriwatknp/mui-treasury/tree/master/.claude/skills/using-base-ui-with-material-ui --skill using-base-ui-with-material-ui --agent claude-code --yesCheck this file in your project.claude/skills/using-base-ui-with-material-ui/SKILL.md
Other ways to install
Choose an assistant interactively
npx skills@latest add https://github.com/siriwatknp/mui-treasury/tree/master/.claude/skills/using-base-ui-with-material-ui --skill using-base-ui-with-material-uiSelect your assistant and choose the project installation scope.
Official instructions
The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. Use an existing React app with Material UI, its configured styling engine, and the Base UI version locked by the project. The fixture used `@base-ui/react` 1.9.0 and `@mui/material` 9.6.0. The Skill examples use the older `@base-ui-components/react` package name.
View operation manualWhat this skill helps with
- Build or refine reusable components for a web interface.
Good for
- Component implementation
- Skill name
- using-base-ui-with-material-ui
- Scenario
- Compose a delivery menu with Material UI styling
- Deliverable
- A project-themed menu trigger with a real selection, keyboard navigation and focus restoration.
- Skill name
using-base-ui-with-material-ui- Repository
siriwatknp/mui-treasury
Define a component task with an observable result
A request with an unclear outcome
Nest a Material UI Button inside a default Base UI trigger button.
Two nested interactive elements break the single focus target expected by the menu.
A workflow with observable results
- Confirm imports and theme context
- Compose the menu and themed popup
- Verify theme and keyboard behavior
Base UI with Material UI operation manual
Use Base UI’s menu behavior with one Material UI trigger and one themed popup.
Replace the bracketed details with your own project and target.
Confirm imports and theme context
Use the published API for the installed dependency.
Prompt · Step 1Use the `using-base-ui-with-material-ui` skill for [delivery menu]. Identify installed Base UI and Material UI versions, the project ThemeProvider and the current trigger. Check the actual Base UI menu export and render API in the installed package. List which props and ref the replacement Button must forward.Compose the menu and themed popup
Keep Base UI state and use Material UI styling at each part.
Prompt · Step 2Use `using-base-ui-with-material-ui` to implement [approved menu]. Compose the Material UI Button through `Menu.Trigger render={<Button />}`. Use the Base UI Portal, Positioner and Popup, rendering a themed MUI Box through the Popup render prop. Apply minimal `sx` with the existing palette and keep Base UI’s role, handlers and ref on the underlying elements. Show the selected record in the local UI.Verify theme and keyboard behavior
Check computed styling and run through selection and dismissal.
- The composed trigger is one focusable button with a theme-derived color.
- Keyboard selection updates the visible UI and Escape returns focus.
Prompt · Step 3Use `using-base-ui-with-material-ui` on [local menu route]. Check that one trigger renders with the active MUI palette color. Open with Enter, move between items with arrow keys, choose an item and confirm the displayed selection. Reopen and press Escape. Check focus returns to the trigger after selection and dismissal, and record the package versions.
Find the relevant rule
Point the assistant to the installed Skill and a specific issue.
Review render composition and ref forwardingReference
- Command or reference
SKILL.md · Base UI as the foundation- Examples
- Check that the styled element spreads props and passes the ref to its real DOM node.
Base UI with Material UI troubleshooting
Which Base UI import should I use?
Read the lockfile and installed exports. The current fixture used `@base-ui/react/menu`. An older project can expose an equivalent subpath under `@base-ui-components/react`.