A vertically stacked set of interactive headings that each reveal a section of content.
❯buridan add accordionUse the following to build the Accordion component.
from components.ui.accordion import accordionFor manual installation, copy each of the source codes below in their respective locations.
Built on native <details>/<summary> — expand/collapse, keyboard support, and the chevron rotation all come from the browser and group-open/accordion-item:rotate-180, no JS required.
Props used: name on accordion.item (groups items so only one stays open at a time, matching native <details name="..."> behavior).
- Genesis launched a new era of exploration.
- Explorer uncovered new planets beyond our reach.
- Voyager 1 ventured into interstellar space.
- Apollo landed humans on the Moon.
- Curiosity sent back valuable data from Mars.
- The Hubble Telescope captured distant galaxies.
- James Webb will explore the universe's origins.
- The ISS orbits Earth, conducting critical experiments.
- Saturn's rings have fascinated scientists for years.
- The Mars Rover is studying the planet's surface.
- NASA's Artemis program aims to return humans to the Moon.
- Solar missions help us understand space weather.
accordion.root(
accordion.item(...),
accordion.item(...),
)
Renders a native <details>. Give matching items the same name to make them mutually exclusive (native <details name="..."> grouping — opening one closes the others in the group automatically).
accordion.item(
accordion.trigger("Is it accessible?"),
accordion.panel("Yes, built on native semantics."),
name="faq",
)
Renders a <summary> with a chevron icon appended automatically — no need to add one yourself.
accordion.trigger("Is it accessible?")
accordion.panel("Yes. It adheres to the WAI-ARIA design pattern.")