Skip to main content
U.S. Flag

An official website of the United States government

CMS Design System


Warning: draft
Jump to Guidance
View related guidance in the U.S. Web Design System

An accordion is a list of headers that hide or reveal additional content when selected.


View Source File

Code snippet


React Properties Documentation

Applies a border to the accordion content.


Class to be applied to the outer <div> that contains all accordion items.


View Source File

AccordionItem renders the Accordion element.

Accordion Item Props

React Properties Documentation

Class to be applied to the header <button> of an accordion item.


Class to be applied to the content <div> tag of an accordion item.


Boolean to expand the accordion.

headingrequiredReact.ReactNode | string

Text for the accordion item heading.

headingLevel'1' | '2' | '3' | '4' | '5' | '6''2'

Heading type to override default <h2>.


If not provided, a unique id will be automatically generated and used.


Sets the accordion panel's open state. Use this in combination with onChange for a controlled accordion; otherwise, set defaultOpen.

onChange() => void

A callback function that's invoked when a controlled accordion panel is selected or deselected.


When to use

  • Use an accordion to see an overview of multiple, related sections of content
  • Use an accordion to show and hide sections as needed

When to consider alternatives

Accordions hide content from users and not everyone will notice them or understand how they work. Accordions increase cognitive load and interaction cost, as users have to make decisions about what headers to click on.

  • Don't use an accordion if users need to see most or all of the information on a page.
  • Don't use an accordion if there is not enough content to warrant condensing.


  • Make the entire header selectable. Allow users to click anywhere in the header area to expand or collapse the content; a larger target is easier to manipulate.
  • Give interactive elements enough space. Make sure interactive elements within the collapsible region are far enough from the headers that users don’t accidentally trigger a collapse.


Keyboard support for the Accordion header includes:

  • Enter or Spacebar - Changes the collapsed/expanded state of the associated accordion panel
  • Arrow Down - Moves focus to the next accordion header
  • Arrow Up - Moves focus to the previous accordion header


The following Sass variables can be overridden to customize Accordion components:

VariableDefault Core Theme Value