Accordion Component
Convert accordion HTML to Liquid for Shopify
Turn collapsible accordion panels into Shopify sections with block-based rows, schema titles and bodies, and drag-and-drop reordering for merchants.
Component overview
Accordion sections beyond basic FAQs
Accordion vs FAQ
Accordion is the interaction pattern; FAQ is one use case. Accordions also appear in shipping info, product specs, and filter groups. Conversion rules match FAQ—block per row—but schema labels should match content (Spec item, Info row) not only FAQ.
HTML to Liquid approach
details/summary is preferred for no-JS baseline accessibility. For themed accordions with icons, block loop with button+panel markup and one section-level JS file. {{ block.shopify_attributes }} on each expandable row wrapper.
Schema patterns
Block: title (text) + body (richtext). Section: allow_multiple_open checkbox, icon style select. Seed preset rows. max_blocks for spec lists that should not exceed practical length.
CSS notes
Animate max-height or use details native toggle—avoid height:auto transitions fighting dynamic content. Icon rotation on open state scoped to section.id. Border between rows consistent when merchants add many blocks.
Accordion mistakes
Mixing accordion JS from HTML export without scoping to section instance (breaks when section used twice). answer in text field when specs need lists/links. No empty state when blocks array empty.
Accordion QA checklist
Multiple sections on same page do not share JS state. Open/close works on iOS Safari. Screen reader announces expanded state. Reorder blocks in editor. Long richtext content does not clip.
Examples
Accordion HTML to Liquid conversion example
How collapsible panels become block-based Shopify section code.
HTML structure
<details class="accordion-item"> <summary>Materials</summary> <p>100% organic cotton.</p> </details>
details/summary rows are ideal accordion candidates—one block per collapsible panel.
Liquid output
"{% for block in section.blocks %}"
<details class="accordion-item" {{ block.shopify_attributes }}>
<summary>{{ block.settings.title }}</summary>
<div>{{ block.settings.content }}</div>
</details>
{% endfor %}Static title and body become block.settings; shopify_attributes links editor to blocks.
Block schema
"type": "accordion_item",
"settings": [
{ "type": "text", "id": "title", "label": "Title" },
{ "type": "richtext", "id": "content", "label": "Content" }
]Each panel exposes a title field and richtext body in the theme editor sidebar.
Section settings
"settings": [
{ "type": "text", "id": "heading", "label": "Heading" },
{ "type": "checkbox", "id": "open_first", "label": "Open first panel" }
]Section settings control module heading and default open state for the first row.
Use cases
Shopify accordion use cases
Collapsible content patterns beyond standard FAQs.
Product detail accordions
Materials, sizing, and care instructions as reorderable blocks on product templates.
Collapsible content sections
Long-form landing page sections with progressive disclosure for dense editorial copy.
Service and pricing accordions
Process steps and tier breakdowns merchants update without redeploying theme code.
Workflow
How accordion conversion works
Paste collapsible HTML and export block-based panels with scoped CSS, schema, and validation.
- 01
Paste HTML
Import accordion markup with all collapsible rows.
- 02
Analyze structure
Detect panel rows and map to block types.
- 03
Generate Liquid
Compile details/summary or button accordion Liquid.
- 04
Generate schema
Create accordion_item blocks and section settings.
- 05
Export section
Add accordion section to product or content templates.
Related
Related tools and component guides
Guide
HTML to Liquid Converter
Free guide — paste component HTML and export a complete Shopify section file.
Open guide →Tool
Open converter workspace
Paste component HTML and export a complete Shopify section file.
Open guide →Generator
Shopify Section Generator
Generate OS 2.0 sections with schema, blocks, and presets.
Open guide →Schema
Liquid Schema Generator
Design schema JSON that pairs with converted component Liquid.
Open guide →Tool
Shopify Liquid Converter
Convert HTML markup into clean Shopify Liquid templates.
Open guide →Blog
Component conversion guides
Read tutorials on sections, schema, and block patterns.
Open guide →Theme
HTML to Dawn Theme
Ship FAQ and content sections on Shopify's reference theme.
Open guide →Theme
HTML to Prestige Theme
Adapt component sections for Prestige editorial storefronts.
Open guide →Theme
HTML to Broadcast Theme
Deploy story-driven component sections on Broadcast.
Open guide →Theme
HTML to Impulse Theme
Use conversion-focused component sections on Impulse.
Open guide →Component
Convert FAQ HTML to Liquid
Turn accordion FAQs into block-based Shopify sections.
Open guide →Component
Convert slider HTML to Liquid
Map carousels to reorderable slide blocks.
Open guide →Component
Convert banner HTML to Liquid
Export promo and announcement banners with schema settings.
Open guide →Component
Convert hero section HTML to Liquid
Build campaign heroes with editable headings and CTAs.
Open guide →Component
Convert product grid HTML to Liquid
Wire collection-driven product grids with schema controls.
Open guide →Component
Convert tabs HTML to Liquid
Convert tabbed panels into merchant-editable sections.
Open guide →Convert HTML to Shopify Liquid
Paste HTML & generate Liquid with schema, blocks, and scoped CSS. No signup required.