You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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?
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
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:
There might be others, specific to certain tags:
value
attribute is inherited from<button>
onCheckbox.Root
. This clashes with howCheckboxGroup
expects thename
of the checkbox and not valuevalue
, but the value should be set on Root. Is this potentially confusing?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:
The text was updated successfully, but these errors were encountered: