Accordions

Accordions enable users to open and close sections of page content.

Usage

When to use an accordion component:

  • If users will only need a few specific pieces of content within a page.
  • If you have only a small space to display a lot of content.

When not to use an accordion component:

  • If users need to see most or all of the information on a page. Use well-formatted text instead.
  • If there is not enough content to warrant condensing. Accordions increase cognitive load and interaction cost, as users have to make decisions about what headers to click on.

Accordion

Content creators should be able to decide if one or more of an accordion's sections are open in its default state. Note that a Show One Accordion could not have more than one section open, by default.

The arrow of an accordion section points toward the current location of that section's content. When the section is closed, the arrow points to the right to indicate that the content is hidden within the link/heading. When an accordion section is open, the arrow points down at the exposed content.

Users can select anywhere on the row of an accordion link/heading to toggle that section open and closed.

Keyboard operation:i

  • Space or Enter = When focus is on the accordion header of a collapsed section, expands the section. When focus is on the header of an expanded section, collapses the section (unless one section must be open at all times).
  • Tab = Moves focus to the next focusable element. All focusable elements in the accordion are included in the page Tab sequence.
  • Shift + Tab = Moves focus to the previous focusable element. All focusable elements in the accordion are included in the page Tab sequence.
  • Down Arrow = When focus is on an accordion header, moves focus to the next accordion header. When focus is on last accordion header, either does nothing or moves focus to first accordion header.
  • Up Arrow = When focus is on an accordion header, moves focus to the previous accordion header. When focus is on first accordion header, either does nothing or moves focus to last accordion header.
  • Home = When focus is on an accordion header, moves focus to the first accordion header.
  • End = When focus is on an accordion header, moves focus to the last accordion header.

Show More / Show Less

When the user selects a "Show More" link option, it retains its position at the end of the content that's revealed, and is replaced with "Show Less".

Do's and Don'ts

Types

Variants

Common Button Labels and Usage

Title case, 2-3 words maximum.
Do not combine actions in a label (exception: "Customize & Buy").
If standard labels don't fit the button's purpose, align label with the task the user is attempting.

Please refer to the Dell Technologies branding website, https://brand.delltechnologies.com/faq/#voice, for further information regarding call-to-action labels and usage.

Button Label:
Corresponding Action:
Add to Cart
Search
Cancel
Save
Edit
Delete
Continue
Next/Previous
Submit
Select
Sign In/Sign Out
View Details
Ok/Cancel
Learn More
Close
Takes users to Cart page, with item added
Used for search buttons
Takes users back to entry point for a task
Used to save an item
Navigates users to change an item
Deletes an item on the page, usually with a verification step
Used as progression
Used as forward and backward navigation (Next is primary, Previous is secondary)
Used to submit a task or info
Used for choosing items in a task flow
Authentication standard, for consistency do not use Log In/Log Out or Signin/Signout
Used instead of “Select” in cases of product details or within learn content
For use in modal verification steps when more specific CTAs will not fit due to space
Used to link users to more learning content or contextual help
Used within modal windows

Accordions

Show One Accordion

<div class="dds__accordion dds__mb-3" id="standard-accordion"> <div class="dds__accordion-card"> <div class="dds__accordion-card-header" id="heading-standard-one"> <h5 class="dds__mb-0"> <button class="dds__accordion-btn dds__d-flex" type="button" data-toggle="dds__collapse" data-parent="#standard-accordion" data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne"> <i class="dds__icons dds__chevron-right" aria-hidden="true"></i> <span class="dds__mx-2">Headline title goes here</span> </button> </h5> </div> <div id="collapseOne" class="dds__collapse dds__show" aria-labelledby="heading-standard-one" aria-expanded="true" role="region" style=""> <div class="dds__accordion-card-body"> The Content Area provides a space for displaying other patterns or content. The Content Area is not part of this pattern. This pattern rather controls the opening and closing of the content area. </div> </div> </div> <div class="dds__accordion-card"> <div class="dds__accordion-card-header" id="heading-standard-two"> <h5 class="dds__mb-0"> <button class="dds__accordion-btn dds__d-flex dds__collapsed" type="button" data-toggle="dds__collapse" data-parent="#standard-accordion" data-target="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo" role="button"> <i class="dds__icons dds__chevron-right" aria-hidden="true"></i> <span class="dds__mx-2">Headline title goes here </span> </button> </h5> </div> <div id="collapseTwo" class="dds__collapse" aria-labelledby="heading-standard-two" aria-expanded="false" style=""> <div class="dds__accordion-card-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. </div> </div> </div> <div class="dds__accordion-card"> <div class="dds__accordion-card-header" id="heading-standard-three"> <h5 class="dds__mb-0"> <button class="dds__accordion-btn dds__d-flex dds__collapsed" type="button" data-toggle="dds__collapse" data-parent="#standard-accordion" data-target="#collapseThree" aria-expanded="false" aria-controls="collapseThree"> <i class="dds__icons dds__chevron-right" aria-hidden="true"></i> <span class="dds__mx-2">Headline title goes here </span> </button> </h5> </div> <div id="collapseThree" class="dds__collapse" aria-labelledby="heading-standard-three" aria-expanded="false" style=""> <div class="dds__accordion-card-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. </div> </div> 

Show Many Accordion

<div id="independent-accordion" class="dds__accordion dds__mb-3"> <div class="dds__show-hide-container"> <button id="indpt-show-all-btn" class="dds__btn-link dds__show-all" aria-expanded="false"> <span>Show All</span> </button> | <button id="indpt-hide-all-btn" class="dds__btn-link dds__hide-all" aria-expanded="false"> <span>Hide All</span> </button> </div> <div class="dds__accordion-card"> <div class="dds__accordion-card-header"> <h5 class="dds__mb-0"> <button class="dds__accordion-btn dds__d-flex" type="button" data-toggle="dds__collapse" data-target="#collapseOneNested" aria-expanded="true" aria-controls="collapseOneNested"> <i class="dds__icons dds__chevron-right" aria-hidden="true"></i> <span id="headline1" class="dds__mx-2">Headline 1 title goes here </span> </button> </h5> </div> <div id="collapseOneNested" role="region" class="dds__collapse dds__show" aria-labelledby="headline1" aria-expanded="true"> <div class="dds__accordion-card-body"> The Content Area provides a space for displaying other patterns or content. The Content Area is not part of this pattern. This pattern rather controls the opening and closing of the content area. </div> <div class="dds__accordion-card-body"> <div class="dds__secondary-accordion"> <h5 class="dds__mb-0"> <button aria-label="Show / Hide content for Secondary Accordion" class="dds__secondary-accordion-btn dds__d-flex dds__collapsed" type="button" data-toggle="dds__collapse" data-target="#secondaryAccordion1" aria-expanded="false" aria-controls="secondaryAccordion1" role="button"> <i class="dds__icons dds__arrow-tri-solid-right" aria-hidden="true"></i> <span class="dds__mx-2"> More Data 1 </span> </button> </h5> <div id="secondaryAccordion1" class="dds__collapse" aria-expanded="true" role="region"> <div class="dds__secondary-accordion-body dds__mb-2"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. </div> </div> </div> <div class="dds__secondary-accordion"> <h5 class="dds__mb-0"> <button aria-label="Show / Hide content for Secondary Accordion" class="dds__secondary-accordion-btn dds__d-flex dds__collapsed" type="button" data-toggle="dds__collapse" data-target="#secondaryAccordion2" aria-expanded="false" aria-controls="secondaryAccordion2"> <i class="dds__icons dds__arrow-tri-solid-right" aria-hidden="true"></i> <span class="dds__mx-2"> More Data 2 </span> </button> </h5> <div id="secondaryAccordion2" class="dds__collapse" aria-expanded="true" role="region"> <div class="dds__secondary-accordion-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. </div> </div> </div> </div> </div> </div> <div class="dds__accordion-card"> <div class="dds__accordion-card-header"> <h5 class="dds__mb-0"> <button class="dds__accordion-btn dds__collapsed dds__d-flex" type="button" data-toggle="dds__collapse" data-target="#collapseTwoNested" aria-expanded="false" aria-controls="collapseTwoNested" role="button"> <i class="dds__icons dds__chevron-right" aria-hidden="true"></i> <span id="headline2" class="dds__mx-2">Headline 2 title goes here </span> </button> </h5> </div> <div id="collapseTwoNested" role="region" class="dds__collapse" aria-labelledby="headline2"> <div class="dds__accordion-card-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. </div> </div> </div> <div class="dds__accordion-card"> <div class="dds__accordion-card-header"> <h5 class="dds__mb-0"> <button class="dds__accordion-btn dds__collapsed dds__d-flex" type="button" data-toggle="dds__collapse" data-target="#collapseThreeNested" aria-expanded="false" aria-controls="collapseThreeNested"> <i class="dds__icons dds__chevron-right" aria-hidden="true"></i> <span id="headline3" class="dds__mx-2">Headline 3 title goes here </span> </button> </h5> </div> <div id="collapseThreeNested" role="region" class="dds__collapse" aria-labelledby="headline3"> <div class="dds__accordion-card-body"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. </div> </div> </div> </div>

Secondary Accordion

<div class="dds__secondary-accordion"> <button aria-label="Show / Hide content for Secondary Accordion" class="dds__secondary-accordion-btn dds__d-flex dds__collapsed" type="button" data-toggle="dds__collapse" data-target="#secondaryAccordion" aria-expanded="false" aria-controls="secondaryAccordion"> <i class="dds__icons dds__arrow-tri-solid-right" aria-hidden="true"></i> <span class="dds__mx-2 dds__more"> Show more </span> <span class="dds__mx-2 dds__less"> Show less </span> </button> <div class="dds__collapse" id="secondaryAccordion" aria-expanded="true" role="region"> <div class="dds__secondary-accordion-body dds__my-2"> Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. </div> </div>
</div>

Show More / Less

Show More / Less List

<section class="dds__container"> <div> <div class="dds__show-hide"> <nav class="dds__mb-1" aria-label="Some example description"> <a class="dds__d-block" href="javascript:;">Link 1</a> <a class="dds__d-block" href="javascript:;">Link 2</a> <a class="dds__d-block" href="javascript:;">Link 3</a> <a class="dds__d-block" href="javascript:;">Link 4</a> <div class="dds__collapse dds__inner" id="collapseShowHideFromButtom" aria-expanded="false"> <a class="dds__d-block" href="javascript:;">Link 5</a> <a class="dds__d-block" href="javascript:;">Link 6</a> <a class="dds__d-block" href="javascript:;">Link 7</a> <a class="dds__d-block" href="javascript:;">Link 8</a> </div> </nav>
</div>
<button class="dds__secondary-accordion-btn dds__d-flex dds__collapsed" type="button" data-toggle="dds__collapse" data-target="#collapseShowHideFromButtom" aria-expanded="false" aria-controls="collapseShowHideFromButtom"> <span class="dds__mx-2 dds__more"> Show more </span> <span class="dds__mx-2 dds__less"> Show less </span>
</button>
</div> </section>

No items found.

No items found.

To be determined.

Accordion buttons and their associated content should be set up in an unstructured list. This enables a visually impaired user to know how many accordion elements there are.

Place an aria-label on the ul tag to let users know that they're dealing with an accordion. (The aria-label is set to ‘Accordion Control Button Group’).

The region role should be applied to the div to create a landmark region that contains the currently expanded accordion panel.

aria-labelledby defines the accessible name for the region element. It also references the accordion header button that expands and collapses the region. Region elements are required to have an accessible name to be identified as a landmark.

Role region is especially helpful to the perception of structure by screen reader users when panels contain heading elements or a nested accordion.

Avoid using the region role in circumstances that create landmark region proliferation (e.g., in an accordion that contains more than approximately 6 panels that can be expanded at the same time).

Accordion Button

A button should be used for triggering an accordion section so it can be navigated by keyboard users via the <tab> button, and so it's accessible to screen readers.

Each accordion button should have a unique id associated with its aria-controls (each button controls this particular id, which references the hidden content beneath it).

Each button should have an aria-expanded attribute. The attribute aria-expanded='true' when the associated content is shown, and ='false' when the content is hidden.

Accordion Content

Every content area should have an id that corresponds to the aria-controls for each button.

Each content area has an aria-hidden attribute that is toggled between true or false. When true, the content is neither visible nor perceivable by screen reader, and assistive technologies will skip this content.