Skip to content

[chip] Add ChipButton, ChipLink and ChipDelete#48015

Open
mj12albert wants to merge 5 commits intomui:masterfrom
mj12albert:feat/interactive-chips
Open

[chip] Add ChipButton, ChipLink and ChipDelete#48015
mj12albert wants to merge 5 commits intomui:masterfrom
mj12albert:feat/interactive-chips

Conversation

@mj12albert
Copy link
Copy Markdown
Member

@mj12albert mj12albert commented Mar 18, 2026

Closes #20470
Closes #47234
Closes #46753
Closes #16097
Closes #23041

Previews:

API as discussed:

<Chip
  label="Bob"
  startAdornment={<Avatar />}
  endAdornment={<PlusIcon />}
  action={<ChipButton onClick={() => {}} />}
/>

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

mui-bot commented Mar 18, 2026

Netlify deploy preview

Bundle size report

Bundle Parsed size Gzip size
@mui/material 🔺+12.3KB(+2.45%) 🔺+2.53KB(+1.74%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Generated by 🚫 dangerJS against f4d6c3e

@mj12albert mj12albert force-pushed the feat/interactive-chips branch 3 times, most recently from 7c03c51 to d30ccd0 Compare March 18, 2026 11:35
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 23, 2026
@mj12albert mj12albert force-pushed the feat/interactive-chips branch from d30ccd0 to 958441c Compare March 23, 2026 07:23
@github-actions github-actions Bot added PR: out-of-date The pull request has merge conflicts and can't be merged. and removed PR: out-of-date The pull request has merge conflicts and can't be merged. labels Mar 23, 2026
@mj12albert mj12albert force-pushed the feat/interactive-chips branch from 958441c to 7aa375f Compare March 24, 2026 10:34
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 24, 2026
@mj12albert mj12albert force-pushed the feat/interactive-chips branch 9 times, most recently from 0ecabdc to 4cb6b07 Compare March 26, 2026 06:21
@mj12albert mj12albert added the type: new feature Expand the scope of the product to solve a new problem. label Mar 26, 2026
@mj12albert mj12albert changed the title [chip] Interactive chips [chip] Add ChipButton, ChipLink and ChipDelete Mar 26, 2026
@mj12albert mj12albert force-pushed the feat/interactive-chips branch 2 times, most recently from becb6d8 to 9d4087d Compare March 26, 2026 08:28
@mj12albert mj12albert marked this pull request as ready for review March 26, 2026 08:39
@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 26, 2026
@mj12albert mj12albert force-pushed the feat/interactive-chips branch from 9d4087d to 9e31b8d Compare March 26, 2026 15:25
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 26, 2026
@mj12albert mj12albert force-pushed the feat/interactive-chips branch from d6fef7e to 70e344b Compare March 29, 2026 16:12
@mj12albert mj12albert force-pushed the feat/interactive-chips branch from 70e344b to 6c399e5 Compare March 29, 2026 16:18
Comment on lines +335 to +337
// Filter out props whose type is only `undefined` (e.g. from `never | undefined`).
// There is no meaningful PropTypes validator for a prop that can only be `undefined`.
filteredNodes = filteredNodes.filter((type) => type.propType.type !== 'UndefinedNode');
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.

what's prop causes this change

* Props forwarded to the start adornment slot.
* By default, the available props are based on the span element.
*/
startAdornment: SlotProps<'span', {}, ChipOwnerState>;
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.

Is using span cause warning in dev when the children is a div e.g. from Avatar?

Image

Copy link
Copy Markdown
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

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

Overall, it looks really good. 👍 Awesome.

For Chip, the effort to make it support legacy and new API in the same component looks fragile to me. Isn't it better if we create a new Chip (v2) with a clean separation, styles classes and theme still shared. For docs, add "Chip v2 [new]" to the sidebar and mark the v1 as deprecated "Chip [deprecated]". Create a codemod for migration.

Image

This way, we reduce the breaking change surface for the current chip, and the code changes from now on will be on v2 only. What do you think?

props: { variant: 'outlined', color },
style: {
color: p(theme, color).main,
border: `1px solid ${theme.alpha(p(theme, color).main, 0.7)}`,
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.

Is this following other component? using p utility

@mj12albert
Copy link
Copy Markdown
Member Author

mj12albert commented Mar 30, 2026

Isn't it better if we create a new Chip (v2) with a clean separation, styles classes and theme still shared. For docs, add "Chip v2 [new]" to the sidebar and mark the v1 as deprecated "Chip [deprecated]"

I'm on board with this, the only thing is how to position it well, v1/v2 maybe confusing at the component level. We used "unstable" before but it looks unappealing to users. Base UI uses "preview" and so does RA, we could do the same?

@siriwatknp
Copy link
Copy Markdown
Member

Isn't it better if we create a new Chip (v2) with a clean separation, styles classes and theme still shared. For docs, add "Chip v2 [new]" to the sidebar and mark the v1 as deprecated "Chip [deprecated]"

I'm on board with this, the only thing is how to position it well, v1/v2 maybe confusing at the component level. We used "unstable" before but it looks unappealing to users. Base UI uses "preview" and so does RA, we could do the same?

I'm good with that.

@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: out-of-date The pull request has merge conflicts and can't be merged. scope: chip Changes related to the chip. type: new feature Expand the scope of the product to solve a new problem.

Projects

None yet

3 participants