Accordions
Collapsible sections built on the native details element: single or multiple, bordered, separated with icons.
Basic
Built on the native details and summary elements, so it works without a script: the browser handles Enter and Space, the open state and the screen reader announcement (“expanded” or “collapsed”). With single, every item gets the same name, so the browser keeps only one open. The chevron turns with group-open.
How do I reset my password?
Can I change my plan later?
Where can I download my invoices?
<div
id="faq-basic"
class="divide-y divide-dominant-200 dark:divide-dominant-700 border-y border-dominant-200 dark:border-dominant-700"
>
<details name="faq-basic" open class="group/acc">
<summary
class="flex items-center justify-between gap-4 px-4 py-3.5 list-none text-left text-sm font-semibold text-dominant-900 dark:text-white cursor-pointer marker:hidden [&::-webkit-details-marker]:hidden hover:bg-dominant-50 dark:hover:bg-dominant-800/60 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<span class="flex items-center gap-3 min-w-0">
<span class="min-w-0">
<span class="block">How do I reset my password?</span>
</span>
</span>
<i
aria-hidden="true"
class="shrink-0 text-xs text-dominant-600 dark:text-dominant-300 transition-transform duration-200 fa-solid fa-chevron-down motion-reduce:transition-none group-open/acc:rotate-180"
>
</i>
</summary>
<div class="px-4 pb-4 text-sm text-dominant-700 dark:text-dominant-200">
Open Sign in and choose “Forgot password”. We send a link that works for one hour.
</div>
</details>
<details name="faq-basic" class="group/acc">
<summary
class="flex items-center justify-between gap-4 px-4 py-3.5 list-none text-left text-sm font-semibold text-dominant-900 dark:text-white cursor-pointer marker:hidden [&::-webkit-details-marker]:hidden hover:bg-dominant-50 dark:hover:bg-dominant-800/60 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<span class="flex items-center gap-3 min-w-0">
<span class="min-w-0">
<span class="block">Can I change my plan later?</span>
</span>
</span>
<i
aria-hidden="true"
class="shrink-0 text-xs text-dominant-600 dark:text-dominant-300 transition-transform duration-200 fa-solid fa-chevron-down motion-reduce:transition-none group-open/acc:rotate-180"
>
</i>
</summary>
<div class="px-4 pb-4 text-sm text-dominant-700 dark:text-dominant-200">
Yes. Upgrades apply at once; downgrades apply at the end of the billing period.
</div>
</details>
<details name="faq-basic" class="group/acc">
<summary
class="flex items-center justify-between gap-4 px-4 py-3.5 list-none text-left text-sm font-semibold text-dominant-900 dark:text-white cursor-pointer marker:hidden [&::-webkit-details-marker]:hidden hover:bg-dominant-50 dark:hover:bg-dominant-800/60 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<span class="flex items-center gap-3 min-w-0">
<span class="min-w-0">
<span class="block">Where can I download my invoices?</span>
</span>
</span>
<i
aria-hidden="true"
class="shrink-0 text-xs text-dominant-600 dark:text-dominant-300 transition-transform duration-200 fa-solid fa-chevron-down motion-reduce:transition-none group-open/acc:rotate-180"
>
</i>
</summary>
<div class="px-4 pb-4 text-sm text-dominant-700 dark:text-dominant-200">
Go to Billing, then Invoices. Every invoice is a PDF.
</div>
</details>
</div>
Multiple and bordered
Without single every item opens on its own, so the person can compare several. A border and rounded corners turn the group into one block; overflow-hidden keeps the hover colour inside the corners.
How do I reset my password?
Can I change my plan later?
Where can I download my invoices?
<div
id="accordion-1497"
class="divide-y divide-dominant-200 dark:divide-dominant-700 overflow-hidden rounded-xl border border-dominant-200 dark:border-dominant-700"
>
<details open class="group/acc">
<summary
class="flex items-center justify-between gap-4 px-4 py-3.5 list-none text-left text-sm font-semibold text-dominant-900 dark:text-white cursor-pointer marker:hidden [&::-webkit-details-marker]:hidden hover:bg-dominant-50 dark:hover:bg-dominant-800/60 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<span class="flex items-center gap-3 min-w-0">
<span class="min-w-0">
<span class="block">How do I reset my password?</span>
</span>
</span>
<i
aria-hidden="true"
class="shrink-0 text-xs text-dominant-600 dark:text-dominant-300 transition-transform duration-200 fa-solid fa-chevron-down motion-reduce:transition-none group-open/acc:rotate-180"
>
</i>
</summary>
<div class="px-4 pb-4 text-sm text-dominant-700 dark:text-dominant-200">
Open Sign in and choose “Forgot password”. We send a link that works for one hour.
</div>
</details>
<details class="group/acc">
<summary
class="flex items-center justify-between gap-4 px-4 py-3.5 list-none text-left text-sm font-semibold text-dominant-900 dark:text-white cursor-pointer marker:hidden [&::-webkit-details-marker]:hidden hover:bg-dominant-50 dark:hover:bg-dominant-800/60 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<span class="flex items-center gap-3 min-w-0">
<span class="min-w-0">
<span class="block">Can I change my plan later?</span>
</span>
</span>
<i
aria-hidden="true"
class="shrink-0 text-xs text-dominant-600 dark:text-dominant-300 transition-transform duration-200 fa-solid fa-chevron-down motion-reduce:transition-none group-open/acc:rotate-180"
>
</i>
</summary>
<div class="px-4 pb-4 text-sm text-dominant-700 dark:text-dominant-200">
Yes. Upgrades apply at once; downgrades apply at the end of the billing period.
</div>
</details>
<details class="group/acc">
<summary
class="flex items-center justify-between gap-4 px-4 py-3.5 list-none text-left text-sm font-semibold text-dominant-900 dark:text-white cursor-pointer marker:hidden [&::-webkit-details-marker]:hidden hover:bg-dominant-50 dark:hover:bg-dominant-800/60 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<span class="flex items-center gap-3 min-w-0">
<span class="min-w-0">
<span class="block">Where can I download my invoices?</span>
</span>
</span>
<i
aria-hidden="true"
class="shrink-0 text-xs text-dominant-600 dark:text-dominant-300 transition-transform duration-200 fa-solid fa-chevron-down motion-reduce:transition-none group-open/acc:rotate-180"
>
</i>
</summary>
<div class="px-4 pb-4 text-sm text-dominant-700 dark:text-dominant-200">
Go to Billing, then Invoices. Every invoice is a PDF.
</div>
</details>
</div>
Separated with icons
Each item is its own card, with an icon and a second line that tells what is inside. Keep the title short; the second line is part of the button name, so it is read too.
Account Profile and sign in
Billing Plans and invoices
Privacy Data and permissions
<div id="accordion-1498" class="space-y-3">
<details
class="group/acc rounded-xl border border-dominant-200 dark:border-dominant-700 bg-white dark:bg-dominant-900 [&>summary]:rounded-xl open:[&>summary]:rounded-b-none"
>
<summary
class="flex items-center justify-between gap-4 px-4 py-3.5 list-none text-left text-sm font-semibold text-dominant-900 dark:text-white cursor-pointer marker:hidden [&::-webkit-details-marker]:hidden hover:bg-dominant-50 dark:hover:bg-dominant-800/60 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<span class="flex items-center gap-3 min-w-0">
<span
aria-hidden="true"
class="flex shrink-0 items-center justify-center size-8 text-primary-800 dark:text-primary-200 bg-primary-100 dark:bg-primary-900/50 rounded-lg"
>
<i class="fa-solid fa-user"> </i>
</span>
<span class="min-w-0">
<span class="block">Account</span>
<span class="block text-xs font-normal text-dominant-700 dark:text-dominant-200"
>Profile and sign in</span
>
</span>
</span>
<i
aria-hidden="true"
class="shrink-0 text-xs text-dominant-600 dark:text-dominant-300 transition-transform duration-200 fa-solid fa-chevron-down motion-reduce:transition-none group-open/acc:rotate-180"
>
</i>
</summary>
<div class="px-4 pb-4 text-sm text-dominant-700 dark:text-dominant-200">
Change your name, photo and e-mail address, and choose how you sign in.
</div>
</details>
<details
open
class="group/acc rounded-xl border border-dominant-200 dark:border-dominant-700 bg-white dark:bg-dominant-900 [&>summary]:rounded-xl open:[&>summary]:rounded-b-none"
>
<summary
class="flex items-center justify-between gap-4 px-4 py-3.5 list-none text-left text-sm font-semibold text-dominant-900 dark:text-white cursor-pointer marker:hidden [&::-webkit-details-marker]:hidden hover:bg-dominant-50 dark:hover:bg-dominant-800/60 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<span class="flex items-center gap-3 min-w-0">
<span
aria-hidden="true"
class="flex shrink-0 items-center justify-center size-8 text-primary-800 dark:text-primary-200 bg-primary-100 dark:bg-primary-900/50 rounded-lg"
>
<i class="fa-solid fa-credit-card"> </i>
</span>
<span class="min-w-0">
<span class="block">Billing</span>
<span class="block text-xs font-normal text-dominant-700 dark:text-dominant-200"
>Plans and invoices</span
>
</span>
</span>
<i
aria-hidden="true"
class="shrink-0 text-xs text-dominant-600 dark:text-dominant-300 transition-transform duration-200 fa-solid fa-chevron-down motion-reduce:transition-none group-open/acc:rotate-180"
>
</i>
</summary>
<div class="px-4 pb-4 text-sm text-dominant-700 dark:text-dominant-200">
See the plan you pay for, download invoices and update your card.
</div>
</details>
<details
class="group/acc rounded-xl border border-dominant-200 dark:border-dominant-700 bg-white dark:bg-dominant-900 [&>summary]:rounded-xl open:[&>summary]:rounded-b-none"
>
<summary
class="flex items-center justify-between gap-4 px-4 py-3.5 list-none text-left text-sm font-semibold text-dominant-900 dark:text-white cursor-pointer marker:hidden [&::-webkit-details-marker]:hidden hover:bg-dominant-50 dark:hover:bg-dominant-800/60 focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-700 dark:focus-visible:ring-primary-400 focus-visible:outline-none"
>
<span class="flex items-center gap-3 min-w-0">
<span
aria-hidden="true"
class="flex shrink-0 items-center justify-center size-8 text-primary-800 dark:text-primary-200 bg-primary-100 dark:bg-primary-900/50 rounded-lg"
>
<i class="fa-solid fa-shield-halved"> </i>
</span>
<span class="min-w-0">
<span class="block">Privacy</span>
<span class="block text-xs font-normal text-dominant-700 dark:text-dominant-200"
>Data and permissions</span
>
</span>
</span>
<i
aria-hidden="true"
class="shrink-0 text-xs text-dominant-600 dark:text-dominant-300 transition-transform duration-200 fa-solid fa-chevron-down motion-reduce:transition-none group-open/acc:rotate-180"
>
</i>
</summary>
<div class="px-4 pb-4 text-sm text-dominant-700 dark:text-dominant-200">
Decide what we keep and for how long. You can export or delete your data at any time.
</div>
</details>
</div>
Options reference
No script; the behaviour is native to the browser.
| Part | Value | Description |
|---|---|---|
details
|
name, open
|
One item. Items with the same name are exclusive; open starts it expanded.
|
summary
|
the title |
The control. It is a real button for the keyboard and for assistive technology; hide the default marker with list-none and marker:hidden.
|
group/acc
|
class on details
|
Lets the chevron and other parts react to group-open/acc:.
|
| Panel | any content |
The content after summary. Do not put the only way to do something in a closed panel.
|
| Keys | Enter, Space | Toggle the focused item; Tab moves to the next one. |