Open eirikbacker opened 2 months ago
ARIA skiller mellom "Accordion" og "Disclosure": https://www.w3.org/WAI/ARIA/apg/patterns/
...og HTML kaller det details
- "the details disclosure element"
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
Se også første notis fra W3C spesifikasjonen: https://html.spec.whatwg.org/multipage/interactive-elements.html#the-details-element:the-details-element-2
Description
Accordion.Item
? Today we require thatAccordion.Item
is always wrapped in a grouping component, but can it occasionally not be a group? :relaxed: See other systems operate with slightly different solutions; some call itCollapsible
orExpandable
so it is less related to it being in a group context.Accordion.Item
s can be opened and closed independently of each other, but maybe that is the intention? :relaxed:Feedback from @Thunear :
Response from @eirikbacker:
Agree - then think that
Expandable
is perhaps a better naming convention, asAccordion
gives the expectation of grouping and one open at a time. I also think thatExpandable
can be used without any wrapper around it - it is entirely possible to get rounded edges etc. with pure CSS that looks for the previous and next element, so that:will "connect with each other" and run as a group, while
rendered separately. The only annoying thing is that you then have to color each Expandable:
Alternatively, we can offer an
Expandable.Group
to have a quick way to wrap everyone, but that it is optional. It can be nice, but also a little assessment of how much we should do for people, because they will anyway often loop over content when they generate such groupings, and then they can put props there immediately (a bit the same as we landed on inToggleGroup
).Regarding one open
Expandable
at a time; If we implement on top of native<details>
, we can offername="..."
to group - when several Expandables have the same name, they are automatically linked together - in exactly the same way asinput type="radio"
works :relaxed :