Skip to content

Accordion

Edit on GitHub

Progressively discloses content sections, letting people expand only what they need to reduce scrolling and cognitive load on pages with secondary or optional content.

@volvo-cars/css v3.3.1@volvo-cars/react-accordion v2.4.0
  • Use an Accordion to organize related information into clearly labeled, independently expandable sections, such as FAQs or product specifications.
  • Use an Accordion to shorten a page and reduce scrolling when content is secondary or not essential for most people to read in full, such as an expandable product description.
  • Use an Accordion when space is limited and long content can’t be shown all at once, such as on mobile or in a side panel.
  • Use an Accordion to give people granular control over how much information they see at once, letting them focus on what matters to them.
  • Don’t use an Accordion when people are likely to read all the content. The extra click adds friction: use a normal page with standard headers instead.
  • Don’t hide critical information or a primary action, such as an alert or confirm/cancel buttons, behind a toggle. Show it inline so people don’t miss it.
  • Don’t use an Accordion for navigation. Use Tabs instead.
  • Don’t use an Accordion to link to sections of the same page. Use a table of contents with anchor links instead.
  • Don’t use an Accordion to organize large amounts of information with a nested hierarchy. Its flat header-and-panel structure doesn’t represent parent-child relationships well: use an indented list instead.
  • Don’t nest accordions within each other to create hierarchy levels. See the nesting guidance below.

Write clear, concise labels that describe the content they toggle. A vague label forces people to open a section just to find out what it contains.

Charging time and range

Charge from 10 to 80 percent in about 30 minutes at a fast charger.

Warranty coverage

Every new car comes with a 4-year warranty.

Delivery options

Choose home delivery or pick up at a retailer near you.

DoUse labels that say what is inside.
More info

Charge from 10 to 80 percent in about 30 minutes at a fast charger.

Details

Every new car comes with a 4-year warranty.

Read more

Choose home delivery or pick up at a retailer near you.

Don't

Don’t use vague labels such as More info or Details.

Place the icon at the end of the header by default. Use the start position for wider sections, where a leading icon helps people scan down a list of headers.

Keep icon placement consistent within the same layout. Avoid using accordions without an icon.

Exterior

Choose from 12 paint colors and 3 wheel designs.

Interior

Pick upholstery, trim and ambient lighting.

Safety

See every driver assistance feature included.

Do

Use the same icon placement for every Accordion in a layout.

Exterior

Choose from 12 paint colors and 3 wheel designs.

Interior

Pick upholstery, trim and ambient lighting.

Safety

See every driver assistance feature included.

Don't

Don’t mix icon placements in the same layout.

Exterior

Choose from 12 paint colors and 3 wheel designs.

Interior

Pick upholstery, trim and ambient lighting.

Safety

See every driver assistance feature included.

DoShow an icon on every header.
Exterior

Choose from 12 paint colors and 3 wheel designs.

Interior

Pick upholstery, trim and ambient lighting.

Safety

See every driver assistance feature included.

Don't

Don’t remove the icon from the header.

Choose spacing inside the expanded content based on what it contains.

If the content includes clickable elements such as buttons, use pb-32 after the last element. The extra space keeps tap areas generous and reduces the risk of accidental taps.

Exterior

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget.

Charging

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget.

Climate

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget.

Show codeHide code
import {
AccordionDetails,
AccordionSummary,
} from '@volvo-cars/react-accordion';
const items = ['Exterior', 'Charging', 'Climate'];
export function SpacingInteractive() {
return (
<>
{items.map((item, index) => (
<AccordionDetails key={item} defaultOpen={index === 0}>
<AccordionSummary>{item}</AccordionSummary>
<div className="flex-col items-start gap-16 pb-32">
<p className="text-secondary">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Suspendisse malesuada lacus ex, sit amet blandit leo lobortis
eget.
</p>
<button type="button" className="button-filled">
Learn more
</button>
</div>
</AccordionDetails>
))}
</>
);
}

If the content is text only, use pb-24 after the last line. The tighter spacing sets a clear visual hierarchy within the group.

Exterior

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget.

Charging

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget.

Climate

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse malesuada lacus ex, sit amet blandit leo lobortis eget.

Show codeHide code
import {
AccordionDetails,
AccordionSummary,
} from '@volvo-cars/react-accordion';
const items = ['Exterior', 'Charging', 'Climate'];
export function SpacingText() {
return (
<>
{items.map((item, index) => (
<AccordionDetails key={item} defaultOpen={index === 0}>
<AccordionSummary>{item}</AccordionSummary>
<p className="pb-24 text-secondary">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse
malesuada lacus ex, sit amet blandit leo lobortis eget.
</p>
</AccordionDetails>
))}
</>
);
}

Don’t nest accordions within each other to create hierarchy levels. Nesting adds cognitive load and inconsistent interaction targets. Flatten the structure, or use an indented list instead.

Paint colors

Choose from 12 paint colors.

Wheel designs

Pick from 3 wheel designs.

Lighting

Compare the available headlight options.

DoKeep Accordion items at the same level.
Exterior
Paint colors

Choose from 12 paint colors.

Wheel designs

Pick from 3 wheel designs.

Don't

Don’t nest accordions within each other.

By default, an Accordion lets people expand and collapse every item independently, with more than one open at a time. This is the recommended behavior.

Use exclusive mode, where opening one item closes the others, only when vertical space is limited and multiple open sections would push key content out of view. See the Exclusive Accordion example.