Closed mikaelrss closed 1 year ago
The Accordion
component from the design system does not seem to react to height changes of the contents. This means that if app developers put content with dynamic heights inside, the Accordion
will behave like this:
and this:
We should therefore limit the Accordion
to be able to contain only elements that we are sure will not resize.
Description
We want to be able to display information with the use of the
Accordion
component from@digdir/design-system-react
.Proposed techincal solution
This needs to be solved as a new componentCan be solved by providing an option toGroup
andRepeatingGroup
which implements theAccordion
component from@digdir/design-system-react
.The new component behaviour ofGroup
andRepeatingGroup
should:Be able to accept a list of options to support multiple items in theAccordion
.Each option should accept atitle
text resource via thetextResourceBindings
-property.Be able to accept dynamic content. Text body should be provided by placing aParagraph
inside theAccordion
.After discussing this with the apps team, we have decided that we will introduce two new components.
Accordion
andAccordionGroup
.Accordion
Accordion
would be a single stand alone component which can have a title and some contents in a body. The contents of the body should be comprised of other Altinn 3 components. If theAccordion
should contain only text, this should be solved with placing aParagraph
inside it. There will be some contraints on what content could go into anAccordion
. The title of theAccordion
will be provided viatextResourceBindings
.Closed state:
Open state:
AccordionGroup
AccordionGroup
should be a component that groupsAccordion
components together. The only content that would be allowed to place inside anAccordionGroup
isAccordions
.Additional Information
The accordion component from digdir's design system