Skip to content

[chip] Interactive chips#47890

Draft
mj12albert wants to merge 6 commits intomui:masterfrom
mj12albert:feat/interactive-chips
Draft

[chip] Interactive chips#47890
mj12albert wants to merge 6 commits intomui:masterfrom
mj12albert:feat/interactive-chips

Conversation

@mj12albert
Copy link
Member

@mj12albert mj12albert commented Mar 2, 2026

@mj12albert mj12albert added the scope: chip Changes related to the chip. label Mar 2, 2026
@mui-bot
Copy link

mui-bot commented Mar 2, 2026

Netlify deploy preview

https://deploy-preview-47890--material-ui.netlify.app/

Bundle size report

Bundle size will be reported once CircleCI build #899662 finishes.

Generated by 🚫 dangerJS against 1a87081

@Moses-main

This comment was marked as off-topic.

@mj12albert mj12albert force-pushed the feat/interactive-chips branch from 4b3a170 to 1a87081 Compare March 3, 2026 08:29
@mj12albert
Copy link
Member Author

mj12albert commented Mar 4, 2026

@silviuaavram @siriwatknp what do you think about splitting up Chip?

Splitting off from the "static" chip gives the "interactive" chip a stable slots structure, which ensures both the "action" slot (button or link) and "delete button" slot are exposed to AT correctly as buttons, which solves the main a11y problem (nested button structure)

The current Material UI and mui-joy derives "interactive vs static" (and "interactive-ness") from various props like onClick and onDelete, causing the "action" slot to be dependent on props at runtime which doesn't seem ideal

@siriwatknp
Copy link
Member

siriwatknp commented Mar 5, 2026

If my understanding is correct, your intention is:

  • non-breaking change and may be deprecated some props on the Chip component?

My concerns:

  • ChipButton does not render button as root element, this might be confusing for user to pass other button related props or handler like onKeyDown, etc. like this <ChipButton slotProps={{ button: { onKeyDown: … } }} /> which is not intuitive.
  • ChipLink kinda break from the pattern where we tell people to use <Button component={NextLink} /> if they want to get the same styles as Button but with link functionality. Since ChipLink does not have different styles than ChipButton, why don't we use the existing pattern? do I miss any extra feature of ChipLink?

With that said, how about this structure from user perspective:

<Chip>
  <ChipButton />
  <ChipDelete />
</Chip>

Also, now that we can fully utilize :has() so styles can be achieved in the structure above.

The above still using the same Chip which can be non-breaking change since the v7 version does not support children prop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: chip Changes related to the chip.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants