Skip to main content

Accordion

Collapsible accordion panels. Tabs: Content, Layout, Behaviour, Styling, Animations, Advanced.

💡 Web dev tip: accordions are the "disclosure" pattern

An accordion is a set of show/hide panels. Each header should be a real <button> carrying aria-expanded="true"/"false" so screen readers know the state, and it must toggle with the keyboard (Enter or Space). UnysonPlus follows this WAI-ARIA pattern for you. W3C: disclosure pattern

Live demo​

▶ See the Accordion live on the demos site — an interactive example you can click through.

Content​

Accordion options panel — Content tab
  • Accordion Items — a repeatable list; each item has a Title, Content (rich text), and an Open by Default switch.

Layout​

Accordion options panel — Layout tab
OptionChoices
Title TagH2–H6 / Span / Paragraph
Icon StylePlus / Minus (+−), Plus / X (+×), Chevron (›), Arrow (▶), No Icon, Custom (image or text/emoji)
Icon PositionLeft, Right
Custom Closed/Open-State ImageUpload (used when Icon Style = Custom)
Custom Closed/Open-State TextText/emoji (used when Icon Style = Custom)
Item NumberingNone · 1, 2, 3 · 01, 02, 03 · a, b, c · A, B, C · i, ii, iii · I, II, III · Q1, Q2, Q3 · Custom…
Custom Template / Start NumberFor custom numbering
Item SpacingGap between items
Title AlignmentLeft (default), Center, Right
Screenshots — icon styles & numbering

These two options have several visible variants worth a screenshot each. Suggested files: accordion-icon-plus-minus, accordion-icon-chevron, accordion-icon-arrow, accordion-numbering-decimal, accordion-numbering-roman in static/img/shortcodes/.

Behaviour​

Accordion options panel — Behaviour tab
OptionChoices
Initially OpenFirst Item, None (All Closed), All Open
CollapsibleOn/Off
Multiple OpenOn/Off
URL Hash Deep-LinkingOn/Off — off by default. When on, opening an item writes a #… hash into the address bar and a link to that hash auto-opens the item. Leave it off to keep the page URL clean.
Show Expand / Collapse All ButtonsOn/Off

Styling​

Accordion options panel — Styling tab

Per-state Title, Content and Icon colors (closed/open), Background Color, and Margin & Padding.

FAQ rich snippet​

FAQ Rich Snippet (Schema), on the Behaviour tab, publishes the accordion as structured data for search engines: each item's title becomes a question and its content the answer. Use it only on a real list of questions and answers, and on the accordions that make up the page's FAQ.

With the SEO extension active, the questions join the page's one structured-data graph (the page becomes an FAQPage) and the accordion doesn't print a separate block, so they are published once. Without it, the accordion prints its own FAQPage block.