Skip to content

Conversation

@atomiks
Copy link
Contributor

@atomiks atomiks commented Dec 30, 2025

Trying to use Omit, & {...}, extends etc. breaks the Button.Props type. All other button components (e.g. Popover.Trigger) do not yet handle this either. It can be solved with overloads, but this also requires wrappers to handle overloads as well to retain the typesafety. The types for all button components can be changed in a separate PR.

Fixes #3641

@atomiks atomiks added component: button Changes related to the button component. type: bug It doesn't behave as expected. typescript labels Dec 30, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 30, 2025

  • vite-css-base-ui-example

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

commit: 81c0869

@mui-bot
Copy link

mui-bot commented Dec 30, 2025

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 0B(0.00%) 0B(0.00%)

Details of bundle changes


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

@netlify
Copy link

netlify bot commented Dec 30, 2025

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 81c0869
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6953330365248f000858bc93
😎 Deploy Preview https://deploy-preview-3643--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.

@atomiks atomiks marked this pull request as ready for review December 30, 2025 02:06
Copy link

@battaglr battaglr left a comment

Choose a reason for hiding this comment

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

Great! I cannot think of any other way of typing this so TS can properly infer types for native and non-native buttons. Maybe there's some TS dark magic that we don't know about? Even then, I think this is a good enough. 🙌

"type": "boolean",
"detailedType": "boolean | undefined"
},
"disabled": {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this removed?

Copy link
Member

Choose a reason for hiding this comment

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

We could add dev-time warnings if native button props are used alongside nativeButton={false}

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

Labels

component: button Changes related to the button component. type: bug It doesn't behave as expected. typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot set Button type prop

4 participants