Accordion
A vertically stacked set of interactive headings that each reveal a section of content.
What are your shipping options?
What is your return policy?
How can I contact customer support?
Usage
Include CSS
Import Tailwind and one full A3S UI style bundle.
Or import only the base CSS, Accordion component CSS, and one style pack.
Using CDN or bundler imports? See the Installation page.
Include JavaScript
Copy or serve the full A3S UI JavaScript bundle.
Or copy or serve the A3S UI runtime and Accordion script.
Using CDN or bundler imports? See the Installation page.
Add your accordion HTML
A3S UI uses native <details> and <summary> elements for disclosure semantics. The accordion JavaScript only enforces single-item behavior by default and prevents disabled items from toggling. Add data-multiple to the root when more than one item can be open at a time.
HTML structure
<section class="accordion">Root accordion container. Add
data-multipleto allow multiple open items.<details open>Accordion item. Use the native
openattribute for the default expanded item. Addaria-disabled="true"when an item should not toggle.<summary>- Accordion trigger. Keep the trigger text visible and add an optional trailing icon.
<section>- Accordion content. Use any semantic element that fits your content.
JavaScript API
Accordion does not expose custom methods or events. Programmatically open or close an item with the native details.open boolean.
Examples
Basic
A basic accordion that shows one item at a time. The first item is open by default.
How do I reset my password?
Can I change my subscription plan?
What payment methods do you accept?
Multiple
Use data-multiple to allow multiple items to be open at the same time.
Notification Settings
Privacy & Security
Billing & Subscription
Disabled
Use aria-disabled="true" on an item to disable it.
Can I access my account history?
Premium feature information
How do I update my email address?
Borders
Add horizontal padding to the rows when using a bordered root.
How does billing work?
Is my data secure?
What integrations do you support?
Card
Wrap the accordion in a card for grouped support or billing content.
Subscription & Billing
Common questions about your account, plans, payments and cancellations.
What subscription plans do you offer?
How does billing work?
How do I cancel my subscription?
RTL
Accordion spacing uses logical properties. Set dir="rtl" on the accordion or a parent element.