base-ui icon indicating copy to clipboard operation
base-ui copied to clipboard

[button] Public useButton hook

Open michael-land opened this issue 10 months ago • 4 comments

Feature request

Summary

Expose the useButton hook allows developers to build additional widget with consistent behavior.

Examples in other libraries

N/A

Motivation

As building custom UI components, I want to leverage the same underlying logic used by the library’s useButton hook - such as keyboard interactions, ARIA attributes, and event normalization—without having to reimplement accessibility features from scratch or copy paste to main own version.

michael-land avatar Apr 05 '25 17:04 michael-land

@michael-land We don't have any plans to do this, and the API is not refined for public use. I'll label this waiting for upvotes for now, but can't promise anything at the moment 🙏

mj12albert avatar Apr 07 '25 13:04 mj12albert

Are there plans to implement a Button component like old Base UI has (and Material UI/Joy UI)?

Studio384 avatar Apr 14 '25 10:04 Studio384

@Studio384 No plans at the moment. What would you want Base UI Button to handle? What would the component do?

colmtuite avatar Apr 15 '25 08:04 colmtuite

https://github.com/mui/base-ui/issues/3258 could be a great use case for a public useButton hook?

Gomah avatar Nov 18 '25 12:11 Gomah