Content · Gutenberg

Accordion block for WordPress

Collapsible accordion panels for FAQ, features, and more.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Collapsible accordion panels for FAQ, features, and more.

Inspector panels on this block: Behavior, Accordion Style, Effects, Header Colors, Content Colors, Border & Icon Colors. Those titles come from index.js, not from a shared template.

Behavior controls: “Allow multiple open” (Allow several panels to be open simultaneously); “Collapse all initially” (Start with all panels closed); “Enable FAQ Schema” (Add FAQPage structured data for SEO); “Accordion Style — Style” options: Default (Separated), Connected, Minimal, Boxed.

Where to find it

Gutenberg inserter → Content → search “Accordion” (block name `blockenberg/accordion` in block.json). Style it in the sidebar after insert.

How to use Accordion block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Accordion”, insert it. Category: Content.
  3. Configure inspector controls that exist on this block. Open Behavior. Set “Allow multiple open”, “First panel open by default”, “Collapse all initially”, “Enable FAQ Schema”.
  4. Check the published page. The view script reads HTML data attributes: data-allow-multiple, data-schema. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Allow multiple openOn/off toggle in the inspector. Allow several panels to be open simultaneously. Off by default. Saved as `allowMultiple`.
First panel open by defaultOn/off toggle in the inspector. On by default. Saved as `firstOpen`.
Collapse all initiallyOn/off toggle in the inspector. Start with all panels closed. Off by default. Saved as `collapseAll`.
Enable FAQ SchemaOn/off toggle in the inspector. Add FAQPage structured data for SEO. Off by default. Saved as `schemaEnabled`.
Accordion Style — StyleSelect control; the chosen value is saved on the block. Options: Default (Separated); Connected; Minimal; Boxed. block.json default: default. Saved as `accordionStyle`.
Icon TypeSelect control; the chosen value is saved on the block. Options: Chevron; Plus/Minus; Arrow; Caret. block.json default: chevron. Saved as `iconType`.
Icon PositionSelect control; the chosen value is saved on the block. Options: Right; Left. block.json default: right. Saved as `iconPosition`.
Icon SizeNumeric range control in the inspector. Range 12–32. block.json default: 20. Saved as `iconSize`.
Gap Between ItemsNumeric range control in the inspector. Range 0–40. block.json default: 12. Saved as `gap`.
Spacing — TopNumeric range control in the inspector. Range 0–40. block.json default: 16. Saved as `headerPaddingTop`.
Spacing — RightNumeric range control in the inspector. Range 0–40. block.json default: 20. Saved as `headerPaddingRight`.
Spacing — BottomNumeric range control in the inspector. Range 0–40. block.json default: 16. Saved as `headerPaddingBottom`.
Spacing — LeftNumeric range control in the inspector. Range 0–40. block.json default: 20. Saved as `headerPaddingLeft`.
Spacing — Top (Content Padding Top)Numeric range control in the inspector. Range 0–40. block.json default: 16. Saved as `contentPaddingTop`.
Spacing — Right (Content Padding Right)Numeric range control in the inspector. Range 0–40. block.json default: 20. Saved as `contentPaddingRight`.
Spacing — Bottom (Content Padding Bottom)Numeric range control in the inspector. Range 0–40. block.json default: 20. Saved as `contentPaddingBottom`.
Spacing — Left (Content Padding Left)Numeric range control in the inspector. Range 0–40. block.json default: 20. Saved as `contentPaddingLeft`.
Border RadiusNumeric range control in the inspector. Range 0–24. block.json default: 8. Saved as `borderRadius`.
Border WidthNumeric range control in the inspector. Range 0–5. block.json default: 1. Saved as `borderWidth`.
Border StyleSelect control; the chosen value is saved on the block. Options: Solid; Dashed; Dotted; None. block.json default: solid. Saved as `borderStyle`.
Show DividerOn/off toggle in the inspector. Show line between header and content. On by default. Saved as `dividerEnabled`.
Divider WidthNumeric range control in the inspector. Range 1–5. block.json default: 1. Saved as `dividerWidth`.
Typography — TitleShared Blockenberg typography popover (family, size, weight, spacing). Saved as `headerTypo`.
Typography — ContentShared Blockenberg typography popover (family, size, weight, spacing). Saved as `contentTypo`.
Enable AnimationOn/off toggle in the inspector. On by default. Saved as `enableAnimation`.
Animation Duration (ms)Numeric range control in the inspector. Range 100–800. block.json default: 300. Saved as `animationDuration`.
Enable Hover EffectOn/off toggle in the inspector. On by default. Saved as `enableHoverEffect`.
Enable ShadowOn/off toggle in the inspector. On by default. Saved as `enableShadow`.
Shadow HorizontalNumeric range control in the inspector. Range -20–20. block.json default: 0. Saved as `shadowHorizontal`.
Shadow VerticalNumeric range control in the inspector. Range -20–20. block.json default: 2. Saved as `shadowVertical`.
Shadow BlurNumeric range control in the inspector. Range 0–40. block.json default: 8. Saved as `shadowBlur`.
Shadow SpreadNumeric range control in the inspector. Range -10–10. block.json default: 0. Saved as `shadowSpread`.
Header Colors — BackgroundColor control in the inspector. block.json default: #f8fafc. Saved as `headerBg`.
Background (Hover)Color control in the inspector. block.json default: #f1f5f9. Saved as `headerBgHover`.
Background (Active)Color control in the inspector. block.json default: #e2e8f0. Saved as `headerBgActive`.
Header Colors — TextColor control in the inspector. block.json default: #1e293b. Saved as `headerColor`.
Text (Hover)Color control in the inspector. block.json default: #0f172a. Saved as `headerColorHover`.
Text (Active)Color control in the inspector. block.json default: #0f172a. Saved as `headerColorActive`.
Content Colors — BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `contentBg`.
Content Colors — TextColor control in the inspector. block.json default: #475569. Saved as `contentColor`.
Border & Icon Colors — BorderColor control in the inspector. block.json default: #e2e8f0. Saved as `borderColor`.
Border (Active)Color control in the inspector. block.json default: #cbd5e1. Saved as `borderColorActive`.
Border & Icon Colors — IconColor control in the inspector. block.json default: #64748b. Saved as `iconColor`.
Icon (Active)Color control in the inspector. block.json default: #3b82f6. Saved as `iconColorActive`.
AccentColor control in the inspector. block.json default: #3b82f6. Saved as `accentColor`.
DividerColor control in the inspector. block.json default: #e2e8f0. Saved as `dividerColor`.
Border & Icon Colors — ShadowColor control in the inspector. block.json default: rgba(0, 0, 0, 0.06). Saved as `shadowColor`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the Accordion block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Accordion”. It sits under Content. After insert, open Behavior and set “Allow multiple open”, “First panel open by default”, “Collapse all initially”, “Enable FAQ Schema”.

Does Accordion output FAQ schema?

Yes, when the schema toggle on this block is on. The front-end script injects FAQPage JSON-LD. That is not the same as Yoast/Rank Math site-wide schema.

Is the Accordion Gutenberg block free?

Yes. Accordion ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Accordion to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Behavior, Accordion Style, Effects, Header Colors).

Related content blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Accordion from the Gutenberg inserter.

Get Blockenberg