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

[core] Consider removing the built-in HTML attributes that clash with the component API #984

Open
vladmoroz opened this issue Dec 6, 2024 · 0 comments
Labels
enhancement This is not a bug, nor a new feature

Comments

@vladmoroz
Copy link
Contributor

vladmoroz commented Dec 6, 2024

There's a few incredibly annoying HTML attributes that are present on every HTML element and can lead to confusion about what is the actual API of our components:

  • defaultValue
  • defaultChecked
  • color

It gets confusing because autocomplete is eager to suggest them on components that are supposed to be used with different props, or when they are presented on parts that don't support either:

image image

There might be others, specific to certain tags:

  • The value attribute is inherited from <button> on Checkbox.Root. This clashes with how CheckboxGroup expects the name of the checkbox and not value
  • Number Field input has value, but the value should be set on Root. Is this potentially confusing?
  • etc

As a reference, in Radix Themes I had done this:
https://github.com/search?q=repo%3Aradix-ui%2Fthemes%20removedprops&type=code
https://github.com/radix-ui/themes/blob/main/packages/radix-ui-themes/src/components/checkbox.tsx#L22

Search keywords:

@vladmoroz vladmoroz added the enhancement This is not a bug, nor a new feature label Dec 6, 2024
@vladmoroz vladmoroz changed the title [core] Consider removing some built-in HTML attributes [core] Consider removing the built-in HTML attributes that clash with the component API Dec 6, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Base UI Alpha Dec 9, 2024
@colmtuite colmtuite modified the milestone: 1.0.0-alpha.1 release Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is not a bug, nor a new feature
Projects
Status: Backlog
Development

No branches or pull requests

2 participants