Skip to content

[button] Document type attribute on ButtonBase#48146

Merged
mj12albert merged 3 commits intomui:masterfrom
mj12albert:button-base-type
Apr 13, 2026
Merged

[button] Document type attribute on ButtonBase#48146
mj12albert merged 3 commits intomui:masterfrom
mj12albert:button-base-type

Conversation

@mj12albert
Copy link
Copy Markdown
Member

@mj12albert mj12albert commented Mar 30, 2026

Closes #21924

Follow up to #47989

string seems the best considering we need to account for:

render(<ButtonBase component="a" href="some-recording.ogg" download type="audio/ogg" />);

Preview: https://deploy-preview-48146--material-ui.netlify.app/material-ui/api/button-base/#button-base-prop-type

@mj12albert mj12albert added docs Improvements or additions to the documentation. scope: button Changes related to the button. component: ButtonBase The React component. labels Mar 30, 2026
@mui-bot
Copy link
Copy Markdown

mui-bot commented Mar 30, 2026

Netlify deploy preview

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

Bundle size report

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@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 70c2624

@mj12albert mj12albert force-pushed the button-base-type branch 4 times, most recently from 3c06809 to 40b91d5 Compare March 30, 2026 13:13
@mj12albert mj12albert marked this pull request as ready for review March 30, 2026 13:29
@zannager zannager requested a review from silviuaavram March 31, 2026 15:31
/**
* @ignore
*/
type: PropTypes.oneOfType([PropTypes.oneOf(['button', 'reset', 'submit']), PropTypes.string]),
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 considered a breaking change? probably not since we are expanding the allowed values.

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.

Yeah widening the type is ok ~

*/
touchRippleRef?: React.Ref<TouchRippleActions> | undefined;
/**
* The [type](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#type) attribute applied to the `button` element.
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.

we expect the ButtonBase to also be a non-native button, maybe we need to change the documentation to reflect that.

Copy link
Copy Markdown
Member

@ZeeshanTamboli ZeeshanTamboli left a comment

Choose a reason for hiding this comment

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

Same comments as Silviu.

@mj12albert mj12albert enabled auto-merge (squash) April 13, 2026 09:09
@mj12albert mj12albert merged commit da74901 into mui:master Apr 13, 2026
23 checks passed
@mj12albert mj12albert deleted the button-base-type branch April 13, 2026 09:24
@oliviertassinari oliviertassinari changed the title [button][button base] Document type attribute [button] Document type attribute Apr 13, 2026
@oliviertassinari oliviertassinari added type: bug It doesn't behave as expected. type: regression A bug, but worse, it used to behave as expected. and removed type: bug It doesn't behave as expected. labels Apr 13, 2026
@oliviertassinari
Copy link
Copy Markdown
Member

oliviertassinari commented Apr 13, 2026

Nice, there is no such thing as a "too old regression" to fix 👍

OK: https://v3.mui.com/api/button-base/#props
KO: https://v4.mui.com/api/button-base/#props

@oliviertassinari oliviertassinari changed the title [button] Document type attribute [button] Document type attribute on ButtonBae Apr 13, 2026
@oliviertassinari oliviertassinari changed the title [button] Document type attribute on ButtonBae [button] Document type attribute on ButtonBase Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: ButtonBase The React component. docs Improvements or additions to the documentation. scope: button Changes related to the button. type: regression A bug, but worse, it used to behave as expected.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[button] Is the 'type' prop really removed from ButtonBase?

6 participants