Skip to main content

Putting together

Now we can use our own Accordion and AccordionItem components as normal. They are WAI-ARIA compliant and support keyboard navigation!

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

import React from 'react';
import Accordion from './Accordion';
import AccordionItem from './AccordionItem';

export default function Example() {
return (
<Accordion>
<AccordionItem header="What is Lorem Ipsum?" initialEntered>
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
</AccordionItem>

<AccordionItem header="Where does it come from?">
Quisque eget luctus mi, vehicula mollis lorem. Proin fringilla
vel erat quis sodales. Nam ex enim, eleifend venenatis lectus
vitae, accumsan auctor mi.
</AccordionItem>

<AccordionItem header="Why do we use it?">
Suspendisse massa risus, pretium id interdum in, dictum sit amet
ante. Fusce vulputate purus sed tempus feugiat.
</AccordionItem>
</Accordion>
);
}