accordion component
Drop-in semantic component. See examples, sizes, variants, and source.
Collapsible content sections. Compose an
accordion wrapper around one or more
item blocks, each containing a
trigger and content.
Variants like plus, arrow,
minimal, and multiple
control the indicator and selection mode. Behaviour (toggling,
keyboard nav, accessibility attributes) comes from
accordion.js.
Accordion System
Default Accordion (Caret Icons)
How do I update my account information?
Insert the accordion description here. It would look better as two lines of text.
What payment methods are accepted?
Major credit and debit cards like Visa, MasterCard, and American Express, as well as digital payment options like PayPal and Apple Pay.
How can I track my order?
Insert the accordion description here. It would look better as two lines of text.
<div class="accordion">
<div class="item" data-state="closed">
<div class="trigger" role="button" tabindex="0">
<div class="left-content">
<svg class="icon" viewBox="0 0 24 24" fill="currentColor">
<path
d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
></path>
</svg>
<span class="title">How do I update my account information?</span>
</div>
<svg class="arrow" viewBox="0 0 24 24" fill="currentColor">
<path
d="M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"
></path>
</svg>
</div>
<div class="content">
Insert the accordion description here. It would look better as two lines of text.
</div>
</div>
<div class="item" data-state="closed">
<div class="trigger" role="button" tabindex="0">
<div class="left-content">
<svg class="icon" viewBox="0 0 24 24" fill="currentColor">
<path
d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM13 13.3551V14H11V12.5C11 11.9477 11.4477 11.5 12 11.5C12.8284 11.5 13.5 10.8284 13.5 10C13.5 9.17157 12.8284 8.5 12 8.5C11.2723 8.5 10.6656 9.01823 10.5288 9.70577L8.56731 9.31346C8.88637 7.70919 10.302 6.5 12 6.5C13.933 6.5 15.5 8.067 15.5 10C15.5 11.5855 14.4457 12.9248 13 13.3551Z"
></path>
</svg>
<span class="title">What payment methods are accepted?</span>
</div>
<svg class="arrow" viewBox="0 0 24 24" fill="currentColor">
<path
d="M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"
></path>
</svg>
</div>
<div class="content">
Major credit and debit cards like Visa, MasterCard, and American Express, as well as digital
payment options like PayPal and Apple Pay.
</div>
</div>
<div class="item" data-state="closed">
<div class="trigger" role="button" tabindex="0">
<div class="left-content">
<svg class="icon" viewBox="0 0 24 24" fill="currentColor">
<path
d="M16.9497 15.9497C19.6834 13.2161 19.6834 8.78392 16.9497 6.05025C14.2161 3.31658 9.78392 3.31658 7.05025 6.05025C4.31658 8.78392 4.31658 13.2161 7.05025 15.9497L12 20.8995L16.9497 15.9497ZM12 23.7279L5.63604 17.364C2.12132 13.8492 2.12132 8.15076 5.63604 4.63604C9.15076 1.12132 14.8492 1.12132 18.364 4.63604C21.8787 8.15076 21.8787 13.8492 18.364 17.364L12 23.7279ZM13 11H17V13H11V6H13V11Z"
></path>
</svg>
<span class="title">How can I track my order?</span>
</div>
<svg class="arrow" viewBox="0 0 24 24" fill="currentColor">
<path
d="M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"
></path>
</svg>
</div>
<div class="content">
Insert the accordion description here. It would look better as two lines of text.
</div>
</div>
</div>
Plus/Minus Icons
How do I update my account information?
Insert the accordion description here. It would look better as two lines of text.
What payment methods are accepted?
Major credit and debit cards like Visa, MasterCard, and American Express, as well as digital payment options like PayPal and Apple Pay.
<div class="accordion plus">
<div class="item" data-state="closed">
<div class="trigger" role="button" tabindex="0">
<div class="left-content">
<svg class="icon" viewBox="0 0 24 24" fill="currentColor">
<path
d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
></path>
</svg>
<span class="title">How do I update my account information?</span>
</div>
<div class="arrow"></div>
</div>
<div class="content">
Insert the accordion description here. It would look better as two lines of text.
</div>
</div>
<div class="item" data-state="closed">
<div class="trigger" role="button" tabindex="0">
<div class="left-content">
<svg class="icon" viewBox="0 0 24 24" fill="currentColor">
<path
d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM13 13.3551V14H11V12.5C11 11.9477 11.4477 11.5 12 11.5C12.8284 11.5 13.5 10.8284 13.5 10C13.5 9.17157 12.8284 8.5 12 8.5C11.2723 8.5 10.6656 9.01823 10.5288 9.70577L8.56731 9.31346C8.88637 7.70919 10.302 6.5 12 6.5C13.933 6.5 15.5 8.067 15.5 10C15.5 11.5855 14.4457 12.9248 13 13.3551Z"
></path>
</svg>
<span class="title">What payment methods are accepted?</span>
</div>
<div class="arrow"></div>
</div>
<div class="content">
Major credit and debit cards like Visa, MasterCard, and American Express, as well as digital
payment options like PayPal and Apple Pay.
</div>
</div>
</div>
Right Arrow Icons
How do I update my account information?
Insert the accordion description here. It would look better as two lines of text.
What payment methods are accepted?
Major credit and debit cards like Visa, MasterCard, and American Express, as well as digital payment options like PayPal and Apple Pay.
<div class="accordion arrow">
<div class="item" data-state="closed">
<div class="trigger" role="button" tabindex="0">
<div class="left-content">
<svg class="icon" viewBox="0 0 24 24" fill="currentColor">
<path
d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
></path>
</svg>
<span class="title">How do I update my account information?</span>
</div>
<svg class="arrow" viewBox="0 0 24 24" fill="currentColor">
<path
d="M8.70710678,12 L8,11.2928932 L13.1928932,6.1 C13.5834175,5.70947573 14.2165825,5.70947573 14.6071068,6.1 C14.9976311,6.49052427 14.9976311,7.12368927 14.6071068,7.51421354 L10.8142136,11.3071068 L14.6071068,15.1 C14.9976311,15.4905243 14.9976311,16.1236893 14.6071068,16.5142136 C14.2165825,16.9047379 13.5834175,16.9047379 13.1928932,16.5142136 L8,11.2928932 L8.70710678,12 Z"
></path>
</svg>
</div>
<div class="content">
Insert the accordion description here. It would look better as two lines of text.
</div>
</div>
<div class="item" data-state="closed">
<div class="trigger" role="button" tabindex="0">
<div class="left-content">
<svg class="icon" viewBox="0 0 24 24" fill="currentColor">
<path
d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM13 13.3551V14H11V12.5C11 11.9477 11.4477 11.5 12 11.5C12.8284 11.5 13.5 10.8284 13.5 10C13.5 9.17157 12.8284 8.5 12 8.5C11.2723 8.5 10.6656 9.01823 10.5288 9.70577L8.56731 9.31346C8.88637 7.70919 10.302 6.5 12 6.5C13.933 6.5 15.5 8.067 15.5 10C15.5 11.5855 14.4457 12.9248 13 13.3551Z"
></path>
</svg>
<span class="title">What payment methods are accepted?</span>
</div>
<svg class="arrow" viewBox="0 0 24 24" fill="currentColor">
<path
d="M8.70710678,12 L8,11.2928932 L13.1928932,6.1 C13.5834175,5.70947573 14.2165825,5.70947573 14.6071068,6.1 C14.9976311,6.49052427 14.9976311,7.12368927 14.6071068,7.51421354 L10.8142136,11.3071068 L14.6071068,15.1 C14.9976311,15.4905243 14.9976311,16.1236893 14.6071068,16.5142136 C14.2165825,16.9047379 13.5834175,16.9047379 13.1928932,16.5142136 L8,11.2928932 L8.70710678,12 Z"
></path>
</svg>
</div>
<div class="content">
Major credit and debit cards like Visa, MasterCard, and American Express, as well as digital
payment options like PayPal and Apple Pay.
</div>
</div>
</div>
Minimal (No Icons)
How do I update my account information?
Insert the accordion description here. It would look better as two lines of text.
What payment methods are accepted?
Major credit and debit cards like Visa, MasterCard, and American Express, as well as digital payment options like PayPal and Apple Pay.
<div class="accordion minimal">
<div class="item" data-state="closed">
<div class="trigger" role="button" tabindex="0">
<div class="left-content">
<svg class="icon" viewBox="0 0 24 24" fill="currentColor">
<path
d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
></path>
</svg>
<span class="title">How do I update my account information?</span>
</div>
<div class="arrow"></div>
</div>
<div class="content">
Insert the accordion description here. It would look better as two lines of text.
</div>
</div>
<div class="item" data-state="closed">
<div class="trigger" role="button" tabindex="0">
<div class="left-content">
<svg class="icon" viewBox="0 0 24 24" fill="currentColor">
<path
d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM13 13.3551V14H11V12.5C11 11.9477 11.4477 11.5 12 11.5C12.8284 11.5 13.5 10.8284 13.5 10C13.5 9.17157 12.8284 8.5 12 8.5C11.2723 8.5 10.6656 9.01823 10.5288 9.70577L8.56731 9.31346C8.88637 7.70919 10.302 6.5 12 6.5C13.933 6.5 15.5 8.067 15.5 10C15.5 11.5855 14.4457 12.9248 13 13.3551Z"
></path>
</svg>
<span class="title">What payment methods are accepted?</span>
</div>
<div class="arrow"></div>
</div>
<div class="content">
Major credit and debit cards like Visa, MasterCard, and American Express, as well as digital
payment options like PayPal and Apple Pay.
</div>
</div>
</div>
Multiple Open Mode
Can I open multiple items?
Yes! This accordion has the 'multiple' class, allowing multiple items to be open simultaneously.
Without the 'multiple' class, opening one item automatically closes others. With 'multiple', all items can be open at once.
Click each item above and notice how they all stay open. Perfect for comparing information or viewing multiple sections at once.
<div class="accordion multiple">
<div class="item" data-state="closed">
<div class="trigger" role="button" tabindex="0">
<div class="left-content">
<svg class="icon" viewBox="0 0 24 24" fill="currentColor">
<path
d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"
></path>
</svg>
<span class="title">Can I open multiple items?</span>
</div>
<svg class="arrow" viewBox="0 0 24 24" fill="currentColor">
<path
d="M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"
></path>
</svg>
</div>
<div class="content">
Yes! This accordion has the 'multiple' class, allowing multiple items to be open
simultaneously.
</div>
</div>
<div class="item" data-state="closed">
<div class="trigger" role="button" tabindex="0">
<div class="left-content">
<svg class="icon" viewBox="0 0 24 24" fill="currentColor">
<path
d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 15H13V17H11V15ZM13 13.3551V14H11V12.5C11 11.9477 11.4477 11.5 12 11.5C12.8284 11.5 13.5 10.8284 13.5 10C13.5 9.17157 12.8284 8.5 12 8.5C11.2723 8.5 10.6656 9.01823 10.5288 9.70577L8.56731 9.31346C8.88637 7.70919 10.302 6.5 12 6.5C13.933 6.5 15.5 8.067 15.5 10C15.5 11.5855 14.4457 12.9248 13 13.3551Z"
></path>
</svg>
<span class="title">What's the difference?</span>
</div>
<svg class="arrow" viewBox="0 0 24 24" fill="currentColor">
<path
d="M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"
></path>
</svg>
</div>
<div class="content">
Without the 'multiple' class, opening one item automatically closes others. With 'multiple',
all items can be open at once.
</div>
</div>
<div class="item" data-state="closed">
<div class="trigger" role="button" tabindex="0">
<div class="left-content">
<svg class="icon" viewBox="0 0 24 24" fill="currentColor">
<path
d="M16.9497 15.9497C19.6834 13.2161 19.6834 8.78392 16.9497 6.05025C14.2161 3.31658 9.78392 3.31658 7.05025 6.05025C4.31658 8.78392 4.31658 13.2161 7.05025 15.9497L12 20.8995L16.9497 15.9497ZM12 23.7279L5.63604 17.364C2.12132 13.8492 2.12132 8.15076 5.63604 4.63604C9.15076 1.12132 14.8492 1.12132 18.364 4.63604C21.8787 8.15076 21.8787 13.8492 18.364 17.364L12 23.7279ZM13 11H17V13H11V6H13V11Z"
></path>
</svg>
<span class="title">Try opening all three!</span>
</div>
<svg class="arrow" viewBox="0 0 24 24" fill="currentColor">
<path
d="M11.9999 13.1714L16.9497 8.22168L18.3639 9.63589L11.9999 15.9999L5.63599 9.63589L7.0502 8.22168L11.9999 13.1714Z"
></path>
</svg>
</div>
<div class="content">
Click each item above and notice how they all stay open. Perfect for comparing information or
viewing multiple sections at once.
</div>
</div>
</div>
Class API Reference
Type
Class
Usage
Notes
Base
accordion
Required wrapper for one or more items
Always required
item
Single collapsible section
Toggle via data-state="open|closed"
trigger
Clickable header for an item
Use role="button" tabindex="0"
content
Body revealed when item is open
Hidden via data-state="closed"
left-content
Inner trigger group for icon + title
Pairs with .icon and .title
Variants
(default)
Caret indicator — rotates 180° when open
No modifier needed
plus
Plus/minus indicator
Modifier on accordion
arrow
Right-arrow indicator — rotates 90° when open
Modifier on accordion
minimal
No expand/collapse indicator
Modifier on accordion
Layout
multiple
Allow multiple items open at once
Default behaviour is single-open
State
data-state="open"
Item is expanded
Attribute on item
data-state="closed"
Item is collapsed
Default state