[Accordion] Component naming #1312
-
During the Accordion refactor to remove material and looking at many design systems, a question came to my head, why do we have two components (Accordion and Accordion Group) for the same thing? "An Accordion is a vertical stack of interactive headings used to toggle the display of further information; each item can be 'collapsed' with just a short label visible or 'expanded' to show the full content." After some research, I haven't found anything about an Accordion Group component, as the Accordion concept itself encompasses one to more sets of interactive headings with expandable content. Another idea that may suit better than what we are trying to represent with our current Accordion is an Expandable section/Details/Disclosure component, but that's just a thought. Bibliography:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
My take on this would be:
|
Beta Was this translation helpful? Give feedback.
-
My first take looking for simplicity would be to keep only the accordionItem rather than the accordion group since I am not aware of any global action applying to all of the items (we have disable, but I was thinking more of a collapseAll action for example) Then, looking at the design system examples you shared, everybody seems to expose the accordion group instead of the individual accordion section, so that's enough for me to change my mind. Regarding the disclosure item, I think this is a wider conversation. To delegate the visibility control of components to a higher component is something that doesn't only affect the accordion, but many others, am I right? |
Beta Was this translation helpful? Give feedback.
-
This has already been implemented. Now there is only one |
Beta Was this translation helpful? Give feedback.
This has already been implemented. Now there is only one
Accordion
component that can be compound of several accordions.The code is available here.