How to Create an Accordion in Joomla 5 and Joomla 6

Learn the practical ways to create an accordion in Joomla 5 and 6, from simple custom content to reusable accordions built from Joomla Articles.

An accordion is useful when a Joomla page contains information that should be easy to scan without displaying every section at once. Common examples include FAQs, service details, product information, documentation and long groups of related articles.

There are several ways to build an accordion in Joomla 5 and Joomla 6. The right method depends on whether the content is one-off, reusable, already stored as Joomla Articles, or needs structured behavior such as deep links and accessibility controls.

What should a good Joomla accordion do?

  • Open and close content without reloading the page.
  • Work on desktop and mobile.
  • Use keyboard-friendly controls.
  • Expose open/closed state correctly to assistive technology.
  • Allow one or several panels to remain open, depending on the use case.
  • Remain manageable when the content changes.

Option 1: Build a small accordion manually

For a single page with only a few items, custom HTML and CSS can be enough. This gives you full control, but you are also responsible for the interaction, keyboard behavior and accessibility state.

This approach works best when the accordion is used only once and the content rarely changes.

Option 2: Use your template or page builder

Many Joomla templates and page builders include an accordion element. This can be convenient when the entire page is already managed through that builder.

Before using it, check whether the content remains portable, whether keyboard navigation is supported and whether you can reuse existing Joomla Articles instead of copying content into builder-specific fields.

Option 3: Build the accordion from Joomla Articles

If your content already exists as Joomla Articles, using those Articles as the source is usually easier to maintain than copying content into a separate accordion editor.

Category: Services

Article: Website Development
Article: Joomla Maintenance
Article: Extension Development
Article: Support

The accordion can render the Article titles as controls and the selected Article content inside the expandable panels.

Use categories and tags to control the collection

Useful filters include:

  • one or more Joomla categories;
  • Joomla tags;
  • featured or non-featured Articles;
  • language;
  • ordering;
  • an Article limit.

Choose the accordion opening behavior

Single open item

Opening one panel closes the previous panel. This keeps long pages compact.

Multiple open items

Several panels can stay expanded. This is useful when users need to compare information between sections.

Think about deep links

https://example.com/help#installation
https://example.com/help#pricing
https://example.com/help#troubleshooting

A good deep-link implementation should open the relevant panel when the URL is loaded and should not create duplicate IDs when several accordions appear on the same page.

Accordion accessibility matters

  • real button controls;
  • aria-expanded for the open/closed state;
  • aria-controls connecting a control to its panel;
  • meaningful heading structure;
  • keyboard navigation where appropriate.

Create a reusable accordion with ES Content Display

ES Content Display can create accordions in Joomla 5 and Joomla 6 using either existing Joomla Articles or Manual Items.

  1. Create or organize the Joomla Articles you want to display.
  2. Create an ES Content Display site module.
  3. Set Content Source to Joomla Articles.
  4. Select the categories and/or tags you want to use.
  5. Choose Accordion as the layout.
  6. Choose the opening behavior.
  7. Publish the module in the required template position and assign it to the appropriate menu items.

If the content only belongs to this particular display, you can use Manual Items instead of creating separate Joomla Articles.

When should you use FAQ mode instead?

An accordion is a visual interaction pattern. An FAQ is a semantic question-and-answer collection.

If every title is genuinely a question and every panel contains its answer, use a dedicated FAQ layout when available. Do not label ordinary accordion content as FAQ simply to obtain structured data.

Frequently asked questions

Does Joomla include a core content accordion for Articles?

Joomla can store the Articles, categories and tags you need, but turning a selected Article collection into a reusable interactive accordion generally requires custom implementation, a template/page-builder element or a dedicated extension.

Can I build an accordion from existing Joomla Articles?

Yes. This is often the most maintainable option because Joomla Articles remain the content source and the accordion controls only presentation.

Can an accordion work on mobile?

Yes. The accordion container and panel content should remain responsive, and interactive controls should be usable on touch devices.

Is an accordion the same as an FAQ?

No. Accordion describes the interaction. FAQ describes the meaning of the content. A FAQ can use an accordion interface, but not every accordion is a FAQ.

Summary

For a one-off layout, custom HTML or a template element may be enough. For reusable content, especially content already stored in Joomla Articles, keep Joomla as the source of truth and use a presentation layer that can filter, order and render those Articles as an accessible accordion.

See the ES Content Display documentation for setup details, Article filtering, deep links and accessibility behavior.