A CSS accordion is a collapsible content panel that hides and reveals a section on click. These 26 hand-coded designs are full-featured FAQ blocks, nav sections, and disclosure panels you can drop into a project today — copy the markup, swap your content, and ship.
26 unique accordions26 Pure CSS0 dependencies100% copy-paste readyPublished
01 / 26
Underline Reveal
Pure CSS
Vertical accordion with a left-anchored underline that grows across the open trigger.
A four-segment ring menu — labels follow each arc via SVG textPath. Selected arc lights up with its theme color, the hub shows the active step number, and the body reveals a matching description.
The cleanest way is the native details and summary elements: each accordion panel is a details element, the clickable header is its summary, and the browser handles open and close for free — no JavaScript. The alternative is the hidden-checkbox pattern: a checkbox toggles a panel via :checked. Every accordion in this gallery is pure CSS using one of these two techniques.
Can a CSS accordion work without JavaScript?
Yes — all 26 accordions here are 100% CSS, no JavaScript. The details/summary element opens and closes natively, and CSS handles the styling, the icon rotation and the reveal. For the smooth height animation, modern CSS uses interpolate-size and ::details-content; browsers without that support simply snap open, which is a graceful fallback.
How do I animate an accordion open and close smoothly in CSS?
Animating to height: auto used to be impossible in CSS. Modern browsers solve it with interpolate-size: allow-keywords plus a transition on the details::details-content block-size. Older browsers fall back to an instant open. Some demos also use a grid-template-rows 0fr to 1fr transition, another pure-CSS way to animate an unknown content height.
What's the difference between a vertical and horizontal accordion?
A vertical accordion stacks panels top to bottom and expands them downward — the familiar FAQ layout. A horizontal accordion places panels side by side and expands them sideways, which suits image galleries and feature showcases. This collection has 17 vertical and 9 horizontal layouts so you can pick whichever fits your space.
Are these CSS accordions accessible?
Yes. The details/summary demos are accessible by default — the browser exposes the expanded state and handles keyboard toggling with Enter and Space. Summaries are real, focusable controls with visible focus states, and any continuous animation honours prefers-reduced-motion. All demos are MIT licensed and free to use.