Skip to main content Skip to footer


Learning Centre

Accordions and Tabs

Accordions are great way to include a lot of content on your page in a way that isn't overwhelming. They display text in lines that open up after a visitor clicks or taps them. You can place any content inside an accordion foldout that you would put directly on a content page. Please note: you will not be able to add components inside an accordion.

Add an accordion

To add an accordion to a page:

  1. Navigate to the page you'd like to add an accordion to
  2. Select the 'Add content' button under the 'Main content' area of the page 'Content' tab
  3. This will open the 'Add content' slide-out panel
  4. From here, select the 'Accordion/Tab' component
  5. Under the 'Content' section, select 'Add Accordion/Tab Item'
  6. Add the accordion item heading and text that will appear when a user opens that accordion item
  7. Click "Create"
  8. Repeat these steps for each accordion item you want to add
  9. Once you have added all your accordion items, click "Create"

Accordion settings

You can adjust the look and layout of your accordion through the settings tab. To access the accordion settings, select the 'Settings' tab located at the top of the 'Accordion/Tab' slide-out panel.

Review each of the Accordion/Tab settings to learn more.

In the 'Name' field you can give a unique name to the Accordion/Tab component. This will make it easier to differentiate between accordions and tabs if you have multiple Accordion/Tab components on the same page. 

When working in the back office you'll see a list of all components on a page and the names will help differentiate between similar components.

In your component settings, you can choose between a tabbed layout or an accordion layout in the 'Layout' section.

Accordion layout

The accordion layout lists your accordion headings vertically on your web page.

example of accordion layout


After selecting this layout, you need to choose your 'Open options'. This determines whether accordion foldouts will be automatically open or closed when a user comes to the web page. You can also choose to have just the first or last item in the accordion list open by default.

Tabbed layout

The tabbed layout lists your accordion headings horizontally on your web page.

Example of tabbed accordion

You can adjust the look of your accordion foldout with the "Accordion/Tab style" section in the component settings. You can choose between the basic, button, underline and line through styles.

Basic

The basic accordion style has each accordion heading and its associated foldout content contained in an outlined box with sharp corners.

Example of basic accordion style

Button

The button accordion style has each accordion heading in its own outlined box with rounded corners, with its associated foldout content appearing below without a box outline.

Example of button accordion style

Underline

The underline accordion style underlines an accordion heading when you open the foldout content below it.

Example of underline accordion style

Line through

The line through accordion style strikes through an accordion heading when you open the foldout content below it.

example of line through accordion style

You can customize the content colours of the accordion using the colours that are part of your website design. Depending on your website design, you can add a coloured background behind the accordion to create a hot spot on the page. 

Colour options

The colour options are based on the design of your website. You may be able to change the design colours depending on your Govstack plan. To get access to the website design features, speak with your GHD Digital Account Executive.

If you'd like, you can add an image to the background of an accordion. To do this, you need to:

  1. Select the "+" icon next to the "Background image" field
  2. This will open the 'Media' folder
  3. From here, choose the folder that contains the image you'd like to add
  4. Select the image you'd like to insert
  5. Press the "Select" button 

Please note

Adding an image behind text can cause colour contrast issues for users with low vision or colour blindness. You should only add an image behind text if it meets the colour contrast ratio requirements associated with accessibility legislation in your region. 

Background image options

You can also set a few options for a background image, including the placement of the image, size of the image and whether or not the image repeats. We recommend testing out the different options until you find the one you like the best.

This setting only applies if you are using a page with a 'Full' page layout. Typically, full page layouts are reserved for the home page of your website or any landing pages you've created.

You can add animation to the accordion by selecting the 'Animate' toggle. Once the 'Animate' toggle is selected, you'll have the option to customize the:

  • Animation style
  • Animation delay (seconds)
  • Animation duration (seconds)

Animation style

From the 'Animation style' dropdown menu, select the type of animation you'd like to add to the accordion. There are a variety of different animation options in the following categories:

  • Attention Seekers
  • Bouncing Entrances
  • Fading Entrances
  • Flippers
  • Light Speed
  • Rotating Entrances
  • Sliding Entrances
  • Zoom Entrances
  • Specials

We recommend testing out a variety of animation styles to select the one you like the most. 

Please note

Animation styles can cause accessibility issues for some users visiting your website. For example, some users may experience motion sickness when viewing animated elements on your website.

Animation delay

Using the 'Animation delay' slider select the time in seconds that you'd like to delay the animation. 

Animation duration

You can select how long you'd like the animation to last on the accordion by using the 'Animation duration' slider. Select the number of seconds you'd like the animation to continue on the public website. 

You can create an anchor link that will link a user to this specific part of the content page. If you'd like to create an anchor link to the accordion in the future, you can add a unique name in the 'Anchor name' field. 

In the 'Custom classes' field, you can add any custom CSS classes you may have. Custom CSS classes can be found in the Design node under the 'CSS' tab in the backend of Govstack. 

If you'd like to add more than one custom class, you'll need to leave a space between each class. 

Please note

Depending on your Govstack plan, you may not be able to access the Design node in the backend. If you'd like to be able to add custom CSS and get access to the website design, contact your GHD Digital Account Executive. 

You can select additional styles to the accordion, including:

  • Spacing
  • Visibility
  • Design

Spacing

You can remove the spacing around the accordion by selecting one of the following options:

  • Remove spacing
  • Remove spacing top only
  • Remove spacing bottom only

Visibility

You can customize the visibility of the accordion. Select one of the following options:

  • Hide on all screens
  • Hide on extra small screens
  • Hide on small screens
  • Hide on medium screens
  • Hide on large screens
  • Hide on extra large screens

Design

Select one of the following options if you'd like to customize the design of the accordion:

  • Show shadows - this will add a shadow effect to the accordion
  • Sticky - the accordion will stay on the screen even as users scroll down the page

Turn on the 'Hide from website' toggle if you'd like to hide this component from the web page.

When to use an accordion

Accordion foldouts can help if your word count or reading grade level is getting high. If you've set up your page using the inverted pyramid,  you can place important details and next steps inside accordion foldouts, but make sure to avoid hiding any “need to know” information.

Accordions also work well if you're presenting a few options to the visitor of your page (e.g., different payment methods) and they have to make a decision.

Preview and publish changes

Once you've added an accordion to your page, make sure to preview and publish the page to complete the process.

Alternative to nested accordions

Nested accordions, also called accordions within accordions, are not possible to create in Govstack. Nested accordions can also lead to accessibility concerns with your website.

An alternative to these nested accordions would be to convert the main accordion to a heading and then have the nested accordions reverted to main accordions below.