Behavior comparison
Accordion stacks sections whose content appears beneath each heading; Tabs swap one panel for another and show only one at a time.
Decision
Should the control switch views, choose a compact mode, or reveal content in the flow?
| Dimension | AccordionAccordion | TabsTabs |
|---|---|---|
| Trigger | Click, tap, Enter, or Space on a section heading button. | Click, tap, or keyboard activation of a tab; arrow keys move within the tab list. |
| Modality | Non-modal disclosure inside the document flow. | Non-modal navigation between related panels in the same context. |
| Placement | Vertically stacked headings with each panel directly following its control. | A tab list directly adjacent to the panel controlled by the active tab. |
| Interactivity | One or several content panels expand and collapse without changing page context. | One tab and panel are active; activation may be automatic or manual depending on loading cost. |
| Focus | Focus remains on the header button when its panel opens or closes. | The tab list is one tab stop; the visible panel is reachable in normal document order when it contains focusable content. |
| Dismissal | Each expanded panel closes by activating its own header when the product allows collapse. | Not applicable: selecting another tab replaces the visible panel without closing the component. |
| Accessible role | heading > button[aria-expanded][aria-controls] + region | tablist > tab + tabpanel |
| Use case | Organizing FAQ answers or optional detail sections | Grouping a few peer views in one workspace |
| Mobile behavior | Use full-width heading buttons and preserve the reading position as panels change height. | Keep labels readable in a horizontally scrollable list; avoid wrapping tabs onto ambiguous rows. |
Audience measurement
With your consent, Google Analytics and aggregate first-party counters measure site usage to help us improve it. These counters contain no search text, candidate, session identifier, or event identifier. You can change your choice anytime via “Cookies” in the footer.