Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to add attributes to input elements created within a React component #3240

Open
bbenjamin opened this issue Nov 20, 2024 · 0 comments

Comments

@bbenjamin
Copy link

Feature request

I'm interested in adding the ability to provide custom props to input elements created within Radix components. I'm also willing to do the work to make this happen, but wanted to first check the likelihood of this being accepted as a feature before putting too much time into implementing it.

Overview

I'm introducing Radix to an existing application that has functionality tied to the assumption that certain elements have specific attributes. I've already run into difficulty with <Checkbox> as there's no way to add custom attributes to the <input> created by <BubbleInput> , and similar difficulty with <TextField> (which ofc is part of the theme repo).

I'd like for <Checkbox> and other components with similar limitations to have an inputProps prop that accepts an object that would be passed to the <input> element created within the component.

Examples in other libraries

Example: MUI has an inputProps prop for its checkbox element

Who does this impact? Who is this for?

  • It would make it much easier for me to integrate Radix UI into Drupal core (I am one of Drupal's maintainers/committers)
  • I suspect this finer level of control would have many benefits, but one that comes to mind is it would make it easier to fix surprise accessibility issues without having to make changes to Radix itself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant