Build Accordions and Tabs

Page Content

How to Use Accordions and Tabs

Accordions and tabs are two different content types with a similar use: They both help to keep pages from overwhelming users with too much content. Accordions and tabs allow page visitors to choose what content is relevant to them in an organized way. In this module, you will learn how to add a new accordion and how to add a new tab.

Learning objectives

  • Learn how accordions and tabs organize content to improve user experience
  • Know when to use accordions versus tabs based on content and audience needs
  • Understand how to set up and style accordions and tabs effectively

Instructions

How to add a new accordion

From the T4 Site Structure, navigate to the page you are updating. 

  1. Click the Add Content button.
  2. Select Accordion from the list of content types.
  3. Use the following content elements:
    • Name: Add descriptive name of content type to be used within T4 Site Structure.
    • Main heading: Optional, used to add a main H3 heading above a group of multiple accordions.
    • Main description: Optional, used to add a main description (sentence or paragraph) prior to a group of multiple accordions. 
    • Heading: Required, used to add the heading/title of the individual accordion (this is what the page viewer will click to expand).
    • Description: Required, used to add the content within the individual accordion. Add text and images using the formatting tools, similar to a word processing program. Learn more about formatting text in T4.
    • Expand/Collapse: Select Yes on the Expand/Collapse Button if you'd like the accordions to hide and unhide all at once.
  4. Click the Save Changes button to save content as a draft, or press the arrow and select Save and Approve to save and publish updates.

Accordions can be added as a single accordion on a page or as a group of multiple accordions on a page.

How to add a new tab

From the T4 Site Structure, navigate to the page you are updating. 

  1. Click the Add Content button.
  2. Select Tab from the list of content types.
  3. Use the following content elements:
    • Name: Add descriptive name of content type to be used within T4 Site Structure.
    • Tab Name: Required, used to add the heading/title of the individual tab (this is what the page viewer will click to toggle between different tabs).
    • Description: Required, used to add the text and image content within the tab. Text and images can be formatted in this field in the same way that you would in other text-based content types. Learn more about formatting text in T4.

      The content in the first tab immediately displays when viewed on a desktop computer. The content in subsequent tabs can only be viewed when the tab heading is selected. It is recommended to include a minimum of two tabs as it would be better to just use a general content type or an accordion if you only need one (depending on if you want to be able to expand/collapse the content or not). 

      When viewed on a mobile device, tabs display and function exactly the same as accordions. 
  4. Click the Save Changes button to save content as a draft, or press the arrow and select Save and Approve to save and publish updates.

Video tutorial


Best practices

  • Use straightforward and descriptive labels so users can easily understand the content in each section
  • Group related content together and present it in a logical order to help users find information quickly
  • Only use accordions or tabs when they genuinely enhance content organization; overusing them can make navigation more complicated

Additional resources

You should now be confident in using accordions and tabs to organize and format text efficiently.


Explore the possibilities: Content type examples

Browse through the examples below to see how the type can be used in different scenarios and design choices.

Examples of the content type

Accordions

On your webpage, an accordion will display as a teal-colored heading that can be expanded when a page viewer clicks on it to view additional content. 

Example

Accordion example 1 heading text

This is description text.

The text within an accordion can be formatted exactly in the same way that text in a general content type is formatted. The only difference is that the section needs to be clicked on to expand in order to view the content within the accordion.

Lorem ipsum

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur consectetur lacinia ligula, id volutpat dolor mattis vel. Pellentesque porta a urna vel porta. Nullam eu massa id orci aliquet imperdiet ut non tellus. Maecenas molestie massa enim. Phasellus quis arcu semper, accumsan dui sed, faucibus nulla. Mauris congue enim id ante dictum bibendum. Nullam facilisis nisi a neque dictum efficitur. Ut tempor ornare aliquet. Fusce cursus urna eget lacus tempor, id rutrum magna mollis. Etiam id dolor elementum magna egestas tincidunt. Phasellus sodales enim enim, sit amet laoreet diam blandit sed. Duis interdum pharetra condimentum. Nam posuere sodales condimentum. Nullam id odio egestas, elementum sem vitae, pellentesque ligula. Sed commodo tempus lacus, in lacinia eros interdum rhoncus.

Nunc orci sem, placerat et tortor eu, scelerisque interdum dui. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque pretium, massa ut dictum rutrum, arcu metus maximus mauris, eget aliquet quam mi ut orci. Proin rutrum, tortor ac congue pharetra, justo diam ultrices nunc, ac congue libero diam sit amet libero. Nunc eget mollis tellus, vel congue dolor. In vestibulum libero eget sem venenatis, varius sodales sem ullamcorper. Sed eleifend diam sit amet tincidunt vestibulum. Mauris accumsan tincidunt sapien at sagittis. Aliquam sit amet turpis vel dui laoreet venenatis. Phasellus felis mi, rutrum at sodales eu, gravida et dui.

Ut commodo nunc quis nibh tristique faucibus. Pellentesque mollis nunc sit amet lacus laoreet vehicula. Praesent pulvinar purus non ultrices gravida. Maecenas placerat turpis vel sagittis porta. Aenean ut arcu lacus. Proin consectetur magna malesuada ligula accumsan, sit amet lobortis sem accumsan. Praesent tincidunt arcu eu tellus blandit, ornare volutpat massa hendrerit. Etiam commodo eget leo auctor aliquet. Maecenas ac sagittis mauris. Nullam aliquam facilisis ipsum, sed lacinia dolor pharetra id. Praesent tempor, massa at rutrum sollicitudin, ipsum lacus dapibus quam, varius faucibus lacus lectus at orci. Integer purus tortor, dapibus lacinia libero sed, commodo elementum lorem. Aenean porta diam in tincidunt interdum. Nunc in fermentum purus. Praesent faucibus consequat est sit amet convallis. Vivamus ut turpis non nulla gravida finibus id nec dui.

This is also heading text (for a second accordion example)

You can choose to include just one accordion, or you can stack multiple accordions in a row.

This page shows an example of two accordions being used in succession.

The first example accordion includes a lot of text while this accordion only includes a few sentences. Both are acceptable uses.

Tabs

The function of a tab on a webpage is responsive to the size of the screen that is used to view the page.

Viewed on a desktop computerScreenshot of a tab on a Studio Site page when viewed on a Desktop computer.

On a desktop computer, all of the content within the first tab is displayed automatically. The headings of subsequent tabs are also displayed, but the page viewer needs to click on the heading of the tab to display the content within it. 

Viewed on a mobile device

Screenshot of a Studio Site Tab on mobile view.On mobile devices, tabs appear exactly like an accordion content type. The heading of each tab needs to be clicked to expand in order to view the content within that tab. A screenshot example of what it looks like on mobile device is included below. You can also see this display difference in the tab examples if you decrease/increase the size of your browser window on a desktop computer. 

Example

Tab 1 Heading Text

This is description text.

The text within a tab can be formatted exactly in the same way that text in a general content type is formatted. The description text within the first tab displays on the page automatically similar to general text as well, with the exception of the headings of subsequent tabs displayed above the content, users can click on the headings to toggle between tabs.

This first tab shows a lot of text, the second tab includes only a little more than a paragraph, the third tab only includes a few sentences. Notice how the display changes as you toggle between the tabs that include different amounts of text (when viewed on a desktop computer). When viewed on a mobile device, the content will display exactly like an accordion content type.

Lorem ipsum

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur consectetur lacinia ligula, id volutpat dolor mattis vel. Pellentesque porta a urna vel porta. Nullam eu massa id orci aliquet imperdiet ut non tellus. Maecenas molestie massa enim. Phasellus quis arcu semper, accumsan dui sed, faucibus nulla. Mauris congue enim id ante dictum bibendum. Nullam facilisis nisi a neque dictum efficitur. Ut tempor ornare aliquet. Fusce cursus urna eget lacus tempor, id rutrum magna mollis. Etiam id dolor elementum magna egestas tincidunt. Phasellus sodales enim enim, sit amet laoreet diam blandit sed. Duis interdum pharetra condimentum. Nam posuere sodales condimentum. Nullam id odio egestas, elementum sem vitae, pellentesque ligula. Sed commodo tempus lacus, in lacinia eros interdum rhoncus.

Nunc orci sem, placerat et tortor eu, scelerisque interdum dui. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque pretium, massa ut dictum rutrum, arcu metus maximus mauris, eget aliquet quam mi ut orci. Proin rutrum, tortor ac congue pharetra, justo diam ultrices nunc, ac congue libero diam sit amet libero. Nunc eget mollis tellus, vel congue dolor. In vestibulum libero eget sem venenatis, varius sodales sem ullamcorper. Sed eleifend diam sit amet tincidunt vestibulum. Mauris accumsan tincidunt sapien at sagittis. Aliquam sit amet turpis vel dui laoreet venenatis. Phasellus felis mi, rutrum at sodales eu, gravida et dui.

Tab 2 Heading Text

This is description text in a second tab.

It is recommended to include a minimum of two tabs (as it would be better to just use a general content type or an accordion if you only need one, depending on if you want to be able to expand/collapse the content or not). This page shows an example of a second tab. The first tab shows a lot of text, this second tab includes only a little more than a paragraph, the third tab only includes a few sentences. 

Notice how the display changes as you toggle between the tabs that include different amounts of text.

Tab 3 Heading Text

This is description text in a third tab.

Notice how the display changes as you toggle between the tabs that include different amounts of text.

Ready to enhance your content further?

Check out the next module.