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
Accordions vs FAQs on Shopify
FAQ sections are a subset of accordion patterns—both use expandable rows. Accordions appear in product details (materials, dimensions, care), service pages (process steps, pricing tiers), and long-form landing pages where content density needs progressive disclosure.
Converting accordion HTML to Liquid follows the same block-based architecture as FAQs but often with richer richtext bodies, optional icons per row, and section settings for allow-multiple-open vs single-open behavior.
Block schema for accordion panels
Each accordion row becomes a block—typically accordion_item with text title and richtext content settings. Optional image_picker or icon settings per row support visual accordions on product pages. Section-level schema controls heading, first-item-open default, and border style.
The "{% schema %}" block should limit blocks to a sensible max—Shopify allows many blocks, but accordions with thirty rows perform poorly in the editor. Group related content into fewer, richer panels when possible.
Semantic markup and accessibility
Native details/summary elements are the most accessible accordion pattern and align with Dawn's collapsible-content section. Button-triggered accordions need aria-expanded, aria-controls, and keyboard handlers—preserve these from your HTML during conversion.
Scoped CSS with section.id handles open/close animations, border-radius on first and last items, and focus ring styles without affecting other theme accordions.
Merchant editing and responsive behavior
Merchants add accordion rows for new product variants, reorder care instructions, and update policy text—all from the block sidebar. Block-based accordions eliminate the copy-paste workflow of editing hardcoded HTML for every product update.
HTMLToLiquid Converter detects collapsible row patterns in HTML, exports Block mode output with validated schema, and scopes CSS so accordion styles stay isolated on product and landing page templates.
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.
Explore
Related tools and component guides
Tool
HTML to Liquid Converter
Paste component HTML and export a complete Shopify section file.
Open →Generator
Shopify Section Generator
Generate OS 2.0 sections with schema, blocks, and presets.
Open →Schema
Liquid Schema Generator
Design schema JSON that pairs with converted component Liquid.
Open →Tool
Shopify Liquid Converter
Convert HTML markup into clean Shopify Liquid templates.
Open →Blog
Component conversion guides
Read tutorials on sections, schema, and block patterns.
Open →Theme
HTML to Dawn Theme
Ship FAQ and content sections on Shopify's reference theme.
Open →Theme
HTML to Prestige Theme
Adapt component sections for Prestige editorial storefronts.
Open →Theme
HTML to Broadcast Theme
Deploy story-driven component sections on Broadcast.
Open →Theme
HTML to Impulse Theme
Use conversion-focused component sections on Impulse.
Open →Component
Convert FAQ HTML to Liquid
Turn accordion FAQs into block-based Shopify sections.
Open →Component
Convert slider HTML to Liquid
Map carousels to reorderable slide blocks.
Open →Component
Convert banner HTML to Liquid
Export promo and announcement banners with schema settings.
Open →Component
Convert hero section HTML to Liquid
Build campaign heroes with editable headings and CTAs.
Open →Component
Convert product grid HTML to Liquid
Wire collection-driven product grids with schema controls.
Open →Component
Convert tabs HTML to Liquid
Convert tabbed panels into merchant-editable sections.
Open →Start converting HTML
Paste your markup and export production-ready Shopify Liquid sections with schema and blocks.
Trust
Built for serious Shopify development
Production-ready sections, validated schema, and workflows theme engineers trust on client projects.
Production-ready output
Export complete section.liquid files with schema, presets, and scoped CSS ready for theme repos.
Built for Shopify developers
Designed for freelancers, agencies, and in-house teams shipping OS 2.0 sections weekly.
OS 2.0 compatible
Output follows Online Store 2.0 conventions—JSON templates, blocks, and valid schema JSON.
Schema validation
Automated checks catch missing presets, invalid setting ids, and common Liquid issues early.
AI-assisted workflow
Optional AI structure detection with deterministic fallback for reliable section generation.
Theme compatibility
Sections align with Dawn, Prestige, Broadcast, Impulse, and custom JSON-template themes.
Generate Shopify sections
Free AI-powered converter — OS 2.0 compatible output with schema validation.