[Checkbox Group] Parent checkbox API suggestion #1067
Labels
breaking change
checkbox group
The React component.
component: checkbox
This is the name of the generic UI component, not the React module!
I've found that the relationship between
<Checkbox parent>
and<CheckboxGroup allValues={...}>
isn't obvious/easily memorable. You need to maintain in your head that two props on separate components are needed to make it work.My proposal, instead of:
Set child names on the parent checkbox directly via a
group
prop:CheckboxGroup
would pass down the current group value to the parent checkbox which then would be responsible for rendering itself as ticked/unticked/indeterminate, and thegroup
prop is memorable because of its relationship toCheckboxGroup
. Also, one fewer prop to have in the API.I thought about
groupValues
too, but decided that I'm not a fan of how thevalues
part misleads you in thinking that you might need to set avalue
on the child checkboxes instead of thename
prop; also,group
is shorter and feels somewhat more declarativeSearch keywords:
The text was updated successfully, but these errors were encountered: