-
Notifications
You must be signed in to change notification settings - Fork 40
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
Replace Accordion
with Details
and Card
#2364
Comments
Related to #2363 |
ARIA skiller mellom "Accordion" og "Disclosure": https://www.w3.org/WAI/ARIA/apg/patterns/ |
...og HTML kaller det |
If anything, I suggest going for
Yes, but what if the accordion is in a layout that adds gap between elements? We can't ensure that we can remove the spacing. Ref for |
Agreed |
Why not call the Thinking out loud here: For single use: <Details>
<Details.Summary> // or just <Summary>?
…
<Details> Now, if you want it to act like an <Accordion>
<Details>
<Details>
<Details>
</Accordion> What do you guys think? |
That could work 🙌 It correlates nicely with In React though, we can use context to add single/multiple open-at-the-time logic to |
What would the
Yeah, my though aswell. Suggest we first try the most simplest approach, and then we can see how the DX feels and iterate on that. |
Meeting 22.11.2024 with @eirikbacker @Febakke @mimarz We decided to try the following in regards to
New <Details>
<Details.Summary>
…
<Details> New approach for equivalent <>
<Details>
<Details>
<Details>
</> New approach for equivalent <Card>
<Details>
<Details>
<Details>
</Card> |
Accordion
with Details
and Card
- Fixes #2364 - `data-color` throws an type error in `showcase.tsx` but this is not related to this branch - Color of details/cards will be adjusted by design, but they wanted to move forward with the currently implemented logic for now --------- Co-authored-by: Tobias Barsnes <tobias.barsnes@digdir.no>
- Fixes #2364 - `data-color` throws an type error in `showcase.tsx` but this is not related to this branch - Color of details/cards will be adjusted by design, but they wanted to move forward with the currently implemented logic for now --------- Co-authored-by: Tobias Barsnes <tobias.barsnes@digdir.no>
Reasoning in #2364 (comment)
Description
Accordion.Item
? Today we require thatAccordion.Item
is always wrapped in a grouping component, but can it occasionally not be a group?Collapsible
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?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 :The text was updated successfully, but these errors were encountered: