Hero Component

Convert hero section HTML to Liquid

Transform campaign hero HTML into Shopify sections with schema-driven headings, CTAs, background media, and scoped CSS—ready for any Online Store 2.0 theme.

Component overview

Hero sections as the foundation of every storefront

Hero HTML structure

Single-instance layout: one headline, subcopy, CTA pair, background media. Nested containers for overlay text on image. Separate mobile background if design specifies different crop—use second image_picker setting.

Liquid conversion approach

Flat mode exclusively for standard heroes. {{ section.settings.heading | escape }}, image_url + image_tag for backgrounds. LCP image: loading eager, explicit width/height when possible. video_url setting instead of raw iframe for video heroes.

Hero schema essentials

heading, subheading, button_label, button_link, background_image, text_alignment (select), overlay_opacity (range). Optional secondary CTA fields. Preset with realistic defaults for demo-ready insert.

Performance and CLS

Hero is usually LCP—do not lazy-load primary image. Cap image_url width to layout needs. Reserve space with aspect-ratio or min-height in scoped CSS to reduce layout shift when image loads.

Hero mistakes

Block mode for single hero. CSS background-image without merchant-controlled image_picker. Hardcoded button href='/collections/all'. Missing mobile text alignment rules. Overlay opacity not exposed to merchants.

Hero QA checklist

Mobile stack order matches design. CTA links work. Empty image state handled. Text readable on background (overlay setting). Lighthouse LCP not regressed vs previous hero.

Examples

Hero HTML to Liquid conversion example

How a campaign hero becomes an editable Shopify section.

HTML structure

<section class="hero">
  <h1>Winter collection</h1>
  <p>New arrivals are here.</p>
  <a href="/collections/winter">Shop now</a>
</section>

Single-instance hero markup maps to section.settings—not blocks—for headline, copy, and CTA.

Liquid output

<h1>{{ section.settings.heading }}</h1>
<p>{{ section.settings.subheading }}</p>
<a href="{{ section.settings.button_link }}">
  {{ section.settings.button_label }}
</a>

Every editable text node and link becomes a section.settings reference.

Schema settings

"settings": [
  { "type": "text", "id": "heading", "label": "Heading" },
  { "type": "text", "id": "subheading", "label": "Subheading" },
  { "type": "image_picker", "id": "bg_image", "label": "Background" },
  { "type": "url", "id": "button_link", "label": "Button link" }
]

Typed settings give merchants text fields, image upload, and URL picker in the editor.

Background Liquid

{{ section.settings.bg_image
  | image_url: width: 2000
  | image_tag: class: 'hero__bg' }}

image_picker settings use Shopify image filters for responsive, CDN-backed delivery.

Use cases

Shopify hero use cases

Hero variants agencies convert from HTML regularly.

Full-width campaign heroes

Seasonal launches with background media, overlay text, and dual CTA schema settings.

Split heroes

Image-left, copy-right layouts with independent media and text settings per column.

Video heroes

video_url settings replace hardcoded embeds—merchants swap campaign videos in the editor.

Workflow

How hero conversion works

Paste hero HTML and export Flat-settings Liquid with scoped CSS, schema, and validation.

  1. 01

    Paste HTML

    Import hero markup with heading, copy, CTA, and media.

  2. 02

    Analyze structure

    Map text nodes, images, and links to setting types.

  3. 03

    Generate Liquid

    Compile hero Liquid with section.settings output.

  4. 04

    Generate schema

    Create settings, preset, and scoped CSS block.

  5. 05

    Export section

    Add hero section.liquid to your theme templates.

Related

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 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 →

Component

Convert accordion HTML to Liquid

Export collapsible panels as repeatable Shopify blocks.

Open guide →

Convert HTML to Shopify Liquid

Paste HTML & generate Liquid with schema, blocks, and scoped CSS. No signup required.