Accordion
Show (and hide) content in a list
Last modified: May 23, 2025
Block names
t2/accordion
, t2/accordion-item
Description
The Accordion block displays content in expandable/collapsible sections, ideal for FAQs, guides, or grouped information. Each item can be opened or closed independently, improving content organization and user experience.
Features
- Collapsible sections for better content management
- Customizable styles via block and style properties
- Supports nested content (text, images, other blocks)
- Accessible and SEO-friendly markup
Properties (t2.json)
allowedBlocks
string[]Allowed inner blocks
layout.icons
Icon size.
Icon used when the accordion item is closed. The icon need to be registered as a T2 icon.
Icon used when the accordion item is open. The icon need to be registered as a T2 icon.
Open icon.
Style properties
Heading color
- --t2-accordion-color-heading
- Theme.json: wp.custom.t2-accordion.color.heading
- Default: inherit
Icon color
- --t2-accordion-color-icon
- Theme.json: wp.custom.t2-accordion.color.icon
- Default: currentColor
Heading font family
- --t2-accordion-typography-heading-font-family
- Theme.json: wp.custom.t2-accordion.typography.heading.font-family
- Default: inherit
Heading font size
- --t2-accordion-typography-heading-font-size
- Theme.json: wp.custom.t2-accordion.typography.heading.font-size
- Default: inherit
Heading font weight
- --t2-accordion-typography-heading-font-weight
- Theme.json: wp.custom.t2-accordion.typography.heading.font-weight
- Default: 700
Heading line-height
- --t2-accordion-typography-heading-line-height
- Theme.json: wp.custom.t2-accordion.typography.heading.line-height
- Default: 1.5
Item border
- --t2-accordion-item-border
- Theme.json: wp.custom.t2-accordion.item-border
- Default: thin
Item padding
- --t2-accordion-item-padding
- Theme.json: wp.custom.t2-accordion.item.padding
- Default: 1rem
Base margin
- --t2-accordion-spacing-margin
- Theme.json: wp.custom.t2-accordion.spacing.margin
- Default: 1.75em
Item gap
- --t2-accordion-spacing-item-gap
- Theme.json: wp.custom.t2-accordion.spacing.item-gap
- Default: --wp--preset--spacing--50