freeCodeCamp / ui

freeCodeCamp's UI Component Library
BSD 3-Clause "New" or "Revised" License
20 stars 19 forks source link

Add Accordion to the library #419

Open huyenltnguyen opened 1 week ago

huyenltnguyen commented 1 week ago

Description

In order to implement the nested super block view, I added headlessui as a dependency to the /learn client (so that we can iterate more quickly).

However, going forward, we should have an Accordion component in the freecodecamp/ui library and replace the direct headlessui import in /learn with this.

There are multiple places using accordion in /learn, and the accordions look different from each other, so I think the component should be named HeadlessAccordion to allow custom styling. Once we have standardized the styles, we can export a separate Accordion component that builds off of the headless one.

Ref: https://github.com/freeCodeCamp/freeCodeCamp/pull/56941/files#diff-a0e7c3d0df31e6f51a3ea780768349415b4f932b5255c0047f2db94c26d6acf9R4-R5.

shootermv commented 1 week ago

question about the new accordion component: does the headlessui package is something that must be used?