Page Loading

Accordion component

Accordions are sections on a page which can be opened and closed to reveal or hide additional information. Multiple accordions can be open at the same time.

There is an option to have an “Open all” and “Close all” function. 

Example

Some accordions just contain plain text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eu dolor tincidunt, viverra nunc et, tincidunt mi. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse eu risus sit amet sapien faucibus bibendum. Maecenas ac sagittis libero. Sed quis nunc hendrerit, elementum tortor nec, rhoncus mauris. 

Some might also contain subheadings

With further information underneath.

There might be a CTA as well 

This accordion contains text as well as an image.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eu dolor tincidunt, viverra nunc et, tincidunt mi. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse eu risus sit amet sapien faucibus bibendum. Maecenas ac sagittis libero. Sed quis nunc hendrerit, elementum tortor nec, rhoncus mauris. 

The alt attribute should be removed

This accordion contains text and a quote. 

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent eu dolor tincidunt, viverra nunc et, tincidunt mi. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse eu risus sit amet sapien faucibus bibendum. Maecenas ac sagittis libero. Sed quis nunc hendrerit, elementum tortor nec, rhoncus mauris. 

We've included some examples of how accordions should appear on full width pages at the end of this page. 

How to use accordions

Only use this component if you’re happy for users to pick and choose which bits of content are relevant to them. If you know users need to read all the information on the page, don’t hide it in an accordion.  

Here are some other rules to bear in mind:

  • Don’t nest an accordion within another accordion
  • Don’t use an accordion on a 50/50 panel
  • Don’t use an accordion if the amount of content inside it would make the page slow to load
  • Avoid adding complex content or components inside an accordion

Before using an accordion, consider if it’s better to:

  • Simplify and reduce the amount of content
  • Split the content across multiple pages
  • Keep the content on a single page, separated by headings
  • Use a list of links to let users navigate quickly to specific sections of content 

Accordions should be aligned to the left side of the page on SE and FBS, but aligned centre on SDI.

Adding accordions in the CMS

This component should be aligned to the left hand side for most of our sites, including Scottish Enterprise and Find Business Support. We do this by adding the component to a container, and adjusting the span of the container rather than the panel. 

Using a template

You can add an accordion to a new panel using the Accordion template, which is already built to be left aligned. 

You can add further accordions to the component by adding a new 'content section'. When you’re adding components within each accordion, you’ll be limited to components which are appropriate for accordions, such as titles text, image and video.  

If you're adding the accordion component to a page with left hand navigation, you'll need to remove the span from the accordion container. 

From scratch

If you don’t use the accordion template when creating a new panel, you’ll need to:

  1. Add a container to your panel
  2. Add an ‘Accordion Component’ to the container
  3. Add a ‘Content section’ for each accordion.
  4. Add the content and components you need into each content section. You'll only be able to add components that are appropriate for accordions
  5. Add the correct modifiers at panel and container level

Your accordion structure in Umbraco should look something like this: 

  • Accordion panel
    • Accordion container 
      • Accordion component
        • Content section 1 / Accordion 1
          • Component
          • Component
        • Content section 2 / Accordion 2
          • Component 
          • Component
        • Content section 3 / Accordion 3
          • Component
          • Component

On SDI, this component should be aligned to the centre of the page. This happens automatically when you apply a span to the panel.

Using a template

You can add an accordion to a new panel using the Accordion template. You can add further accordions to the components by adding a new 'content section'. When you’re adding components within each accordion, you’ll be limited to components which are appropriate for accordions, such as titles text, image and video.  

From scratch

If you don’t use the accordion template when creating a new panel, you’ll need:

  1. Add an ‘Accordion Component’ to the panel
  2. Add a ‘Content section’ for each accordion
  3. Add the content and components you need to each content section/accordion.You'll only be able to add components that are appropriate for accordions
  4. Apply the correct modifiers 

Your accordion structure in Umbraco should look something like this: 

  • Accordion panel
    • Accordion component
      • Content section 1 / Accordion 1
        • Component
        • Component
      • Content section 2 / Accordion 2
        • Component
        • Component
      • Content section 3 / Accordion 3
        • Component
        • Component

Accordion modifier rules

  • Background: default (white), ‘background’ (grey) or 'primary'
  • Grid span: 8 
    • Standard - applied at container level. Removed on pages with left hand navigation
    • SDI - applied at panel level
  • Padding: default
  • Alignment: default

Accessibility

Accordions are commonly used to reduce the need to scroll when presenting multiple sections of content on a single page, but they can increase the interaction cost by requiring users to decide on a heading. You should consider this when deciding whether accordions are appropriate for the page you’re building, the information within the accordions, and the users who’ll be reading it. 

Make sure headings are descriptive so users are clear about what information each accordion contains. Avoid adding a long list of accordion links, as this can be hard to read.

We’ve used some sr-only text as well as aria code to help make accordions more accessible to assistive technology.  

Evidence and research

In testing users like using accordions, they like how content is broken up into smaller chunks and they have the option to open to reveal further information. We have added a link to open all or close all to give the user more control over the interaction. 

Here's how accordions should look as standard

This includes the majority of our sites, including Scottish Enterprise and Find Business Support. They're aligned to the left hand side of the page, with a span of 8. We do this by adding the accordions (as well as a heading and introduction text if relevant) into a container within the panel. Then we apply a span of 8 to the container rather than the panel.

Advanced Manufacturing Innovation District Scotland (AMIDS) 

AMIDS is leading the way in collaborative innovation. A net zero campus housing institutes of excellence, major research centres, international manufacturers and business park infrastructure.

AMIDS website opens in a new window  

Investment opportunities at AMIDS

 

National Manufacturing Institute Scotland (NMIS) 

Industry-led manufacturing R&D facilities, providing ground-breaking collaborations to transform productivity levels, competitiveness and skills.

NMIS website opens in a new window  

Global Open Finance Centre of Excellence (GOFCE) at the University of Edinburgh

This world-first centre has secured £55 million funding to develop financial technology and education to deliver social and economic benefits around the world. This will include how best to use open finance, the sharing of consenting customers' data between different financial businesses.

The university will partner with the Financial Data and Technology Association (FDATA) and FinTech Scotland and draw on expertise from academia, financial services and fintech businesses.

GOFCE website opens in a new window  

BioHub - Aberdeen

A transformational £40 million BioHub project to double the size of north east Scotland’s high-growth life sciences company cluster has moved into its main construction phase.

Find out more opens in a new window  

 

Digital Health Institute

Defining and designing the digital health and care future for a healthier Scotland.

Find out more opens in a new window  

 

Edinburgh BioQuarter

Edinburgh BioQuarter is already a leading global destination for healthcare delivery, groundbreaking medical research and life sciences innovation and entrepreneurship.

BioQuarter's £1 billion masterplan will create Edinburgh’s Health Innovation District, a new vibrant mixed-use neighbourhood, ultimately supporting a community of more than 20,000 people. A global hub that will become home to healthcare innovators, honoured clinicians and academics, a global top-20 medical school, hospitals and a host of award-winning scientific research institutes.

Investment opportunities at Edinburgh BioQuarter 

Here's how accordions should look on SDI

They're centre aligned, but still left justified. This includes a heading and paragraph text if relevant. We do this by adding a span of 8 to the whole panel.

Advanced Manufacturing Innovation District Scotland (AMIDS) 

AMIDS is leading the way in collaborative innovation. A net zero campus housing institutes of excellence, major research centres, international manufacturers and business park infrastructure.

AMIDS website opens in a new window  

Investment opportunities at AMIDS

 

National Manufacturing Institute Scotland (NMIS) 

Industry-led manufacturing R&D facilities, providing ground-breaking collaborations to transform productivity levels, competitiveness and skills.

NMIS website opens in a new window  

Global Open Finance Centre of Excellence (GOFCE) at the University of Edinburgh

This world-first centre has secured £55 million funding to develop financial technology and education to deliver social and economic benefits around the world. This will include how best to use open finance, the sharing of consenting customers' data between different financial businesses.

The university will partner with the Financial Data and Technology Association (FDATA) and FinTech Scotland and draw on expertise from academia, financial services and fintech businesses.

GOFCE website opens in a new window  

BioHub - Aberdeen

A transformational £40 million BioHub project to double the size of north east Scotland’s high-growth life sciences company cluster has moved into its main construction phase.

Find out more opens in a new window  

 

Digital Health Institute

Defining and designing the digital health and care future for a healthier Scotland.

Find out more opens in a new window  

 

Edinburgh BioQuarter

Edinburgh BioQuarter is already a leading global destination for healthcare delivery, groundbreaking medical research and life sciences innovation and entrepreneurship.

BioQuarter's £1 billion masterplan will create Edinburgh’s Health Innovation District, a new vibrant mixed-use neighbourhood, ultimately supporting a community of more than 20,000 people. A global hub that will become home to healthcare innovators, honoured clinicians and academics, a global top-20 medical school, hospitals and a host of award-winning scientific research institutes.

Investment opportunities at Edinburgh BioQuarter