Accordion
Expandable questions and answers, one open at a time.
How does it work?
Pick a component, copy the code or the prompt and paste it into your project.
Is it free?
Yes, everything is open source and free to use.
Can I change the color?
Via the custom property --accent.
BackgroundGridAccent
Corners
SharpRound
Shadow
NoneStrong
Motion
NoneBounce
<style>
.ux-acc{width:100%;max-width:260px;border-top:1px solid var(--line,#cfd2da);font:15px system-ui;color:var(--fg,#14151a)}
.ux-acc details{border-bottom:1px solid var(--line,#cfd2da)}
.ux-acc summary{display:flex;justify-content:space-between;align-items:center;padding:14px 2px;font-weight:600;cursor:pointer;list-style:none}
.ux-acc summary::-webkit-details-marker{display:none}
.ux-acc summary::after{content:"";width:8px;height:8px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg);transition:transform var(--dur,.4s) var(--ease,ease)}
.ux-acc details[open] summary::after{transform:rotate(-135deg)}
.ux-acc details::details-content{height:0;overflow:clip;transition:height var(--dur,.35s) var(--ease,ease),content-visibility var(--dur,.35s) allow-discrete var(--ease,ease)}
.ux-acc details[open]::details-content{height:auto}
.ux-acc{interpolate-size:allow-keywords}
.ux-acc p{margin:0 0 14px;color:var(--muted,#6b6f7b);line-height:1.5}
.ux-acc details[open] p{animation:ux-acc-in var(--dur,.35s) var(--ease,ease)}
@keyframes ux-acc-in{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.ux-acc details[open] p{animation:none}.ux-acc details::details-content{transition:none}}
</style>
<div class="ux-acc">
<details name="ux-faq" open><summary>How does it work?</summary><p>Pick a component, copy the code or the prompt and paste it into your project.</p></details>
<details name="ux-faq"><summary>Is it free?</summary><p>Yes, everything is open source and free to use.</p></details>
<details name="ux-faq"><summary>Can I change the color?</summary><p>Via the custom property --accent.</p></details>
</div>When to use it
Use this to group related content into a single, scannable unit, especially when you are showing several of them next to each other.
Accessibility
It is fully keyboard operable: tab to it and use the keys you would expect (space, enter or the arrow keys) to change its value, with a visible focus ring so sighted keyboard users can always see where they are. Colors are read from CSS custom properties, so they follow your light or dark theme and you can raise contrast globally without touching this component.