Skip to content

[menu] Add <Menu.LinkItem> part - #3400

Merged
mj12albert merged 20 commits into
mui:masterfrom
mj12albert:menu-item-link
Jan 23, 2026
Merged

mj12albert merged 20 commits into
mui:masterfrom
mj12albert:menu-item-link

Conversation

@mj12albert

@mj12albert mj12albert commented Dec 3, 2025 •

Copy link
Copy Markdown
Member

Replacement for <MenuItem render={<a href="#" />}

It's LinkItem since we're already using this name elsewhere:

Screenshot 2026-01-06 at 8 55 10 PM

Preview: https://deploy-preview-3400--base-ui.netlify.app/experiments/menu/menu-fully-featured

@mj12albert mj12albert added component: menu Changes related to the menu component. breaking change Introduces changes that are not backward compatible. labels Dec 3, 2025
@pkg-pr-new

pkg-pr-new Bot commented Dec 3, 2025 •

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@3400
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@3400
    

commit: 7d9436e

@mj12albert mj12albert mentioned this pull request Dec 3, 2025
1 task done
@mui-bot

mui-bot commented Dec 3, 2025 •

Copy link
Copy Markdown

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 🔺+645B(+0.15%) 🔺+119B(+0.09%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Dec 3, 2025

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit dd405c8
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6930307c9e344d00081e86e5
😎 Deploy Preview https://deploy-preview-3400--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Dec 3, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 7d9436e
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/697394bf04c6f00008494918
😎 Deploy Preview https://deploy-preview-3400--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mj12albert
mj12albert marked this pull request as ready for review December 3, 2025 13:03
@mj12albert

This comment was marked as resolved.

@mj12albert mj12albert removed the breaking change Introduces changes that are not backward compatible. label Dec 4, 2025
@mj12albert mj12albert changed the title [menu] Add MenuLinkItem [menu] Add Menu.Link Dec 4, 2025
@LukasTy LukasTy changed the title [menu] Add Menu.Link [menu] Add <Menu.Link> part Dec 4, 2025

@LukasTy LukasTy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. 👍
Am I missing something? Or does this component really is missing the menuitem prop?
Screen reader behavior in the experiment example is not optimal. 🙈

@mj12albert
mj12albert force-pushed the menu-item-link branch 2 times, most recently from 6366c8f to 7da6bb0 Compare December 4, 2025 17:00
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 9, 2025
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Dec 16, 2025
@mj12albert mj12albert changed the title [menu] Add <Menu.Link> part [menu] Add <Menu.LinkItem> part Jan 6, 2026
Comment on lines +51 to +59
itemProps,
elementProps,
{
id,
role: 'menuitem',
tabIndex: highlighted ? 0 : -1,
onMouseMove(event) {
if (!nodeId) {
return;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a generic hook to reuse between both components?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, it would be nice to co-locate at least part of the code between MenuItem and MenuLinkItem.
Did it prove too difficult? 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 4f30ff8

My first go at claude code 😬

Comment thread docs/reference/generated/menu-link.json Resolved
Comment on lines +51 to +59
itemProps,
elementProps,
{
id,
role: 'menuitem',
tabIndex: highlighted ? 0 : -1,
onMouseMove(event) {
if (!nodeId) {
return;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, it would be nice to co-locate at least part of the code between MenuItem and MenuLinkItem.
Did it prove too difficult? 🤔

@LukasTy LukasTy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. 👍 👏
Just a few final nitpicks. 🙈

@mj12albert
mj12albert requested review from LukasTy and atomiks January 21, 2026 16:18
@LukasTy LukasTy added the type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature. label Jan 22, 2026

@LukasTy LukasTy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. 👍 💯

Comment thread test/e2e/index.test.ts Resolved
@mj12albert
mj12albert merged commit c716d7f into mui:master Jan 23, 2026
@mj12albert
mj12albert deleted the menu-item-link branch January 23, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: menu Changes related to the menu component. type: enhancement It’s an improvement, but we can’t make up our mind whether it's a bug fix or a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants