Brand Guide

Components

Accordion

A list of headings that each open to show their content, for questions and answers.

Default

Open by default

defaultValue is the list of items that start open.

£120,000 to £140,000, with equity on top.

Multiple

With multiple, opening one item leaves the others as they are.

£120,000 to £140,000, with equity on top.

London, two days a week in the office near Old Street.

Controlled

value and onValueChange hold the open items in your own state.

Disabled item

Kept in the page

keepMounted leaves a closed answer in the HTML, hidden, instead of removing it. It looks the same.

Best practices

  • One item is open at a time, and the open item can always be closed. Pass multiple when a reader will want two answers side by side.
  • value and defaultValue are arrays, with or without multiple: defaultValue={['salary']}.
  • Pass keepMounted to the content on public pages, such as a job page's questions, so the closed answers are in the HTML for a crawler that does not run JavaScript.
  • className on AccordionContent styles the block inside the panel, not the panel, which only clips and animates.