Skip to content

Accordion

Product Information

Our flagship product combines cutting-edge technology with sleek design. Built with premium materials, it offers unparalleled performance and reliability.

Shipping Details

We offer worldwide shipping through trusted courier partners. Standard delivery takes 3-5 business days, while express shipping ensures delivery within 1-2 business days.

Return Policy

We stand behind our products with a comprehensive 30-day return policy. If you are not completely satisfied, simply return the item in its original condition.

<div class="accordion">
<details class="accordion-item" name="faq" open>
<summary class="accordion-trigger">
Product Information
<svg class="accordion-icon"></svg>
</summary>
<div class="accordion-content"></div>
</details>
</div>

The open state lives in the <details> element, so there is no JavaScript: the browser toggles the section, and name is what makes the group exclusive.

ClassPart
.accordionThe stack
.accordion-itemOne <details> section
.accordion-triggerThe <summary> that opens it
.accordion-iconThe chevron, rotated when open
.accordion-contentWhat is revealed
AttributeOnMeaning
name="…".accordion-itemShared name: opening one closes the others
open.accordion-itemStarts expanded
aria-disabled="true".accordion-triggerCannot be opened

A shared name makes the group exclusive, the way a radio group is. Opening a section closes whichever was open — the overview above does exactly this.

Drop the name and every section is independent.

Is it accessible?

Yes. It uses the browser's own disclosure element, so it is announced without help.

Can two be open at once?

Here, yes — none of these share a name, so each one opens on its own.

Available

This section opens as usual.

Coming soon

Never reached: the trigger takes no pointer events and is out of the tab order.

aria-disabled styles the trigger and stops pointer events; tabindex="-1" takes it out of the tab order. A <summary> has no disabled attribute, which is why it takes both.

An accordion is a group of sections that behave as one, usually with one open at a time. A collapsible is a single disclosure with no group and no styling of its own. If there is only one thing to reveal, it is a collapsible.

Set dir="rtl" on the page or on any subtree — the chevron moves to the leading edge on its own. See the button page for a live example.

  • The browser does the work. <details>/<summary> is announced as a disclosure with its expanded state, and responds to Enter and Space, without any ARIA from you.
  • Do not add role="button" to the summary. It already has the right role, and overriding it loses the expanded state.
  • Headings still matter. If the trigger is a section heading on the page, wrap its text in an <h3> inside the <summary> so it appears in the heading outline.
  • aria-disabled, not hidden. A section that cannot be opened should still be readable and announced as unavailable, rather than disappearing.