← Back to guides
TutorialShopify SectionsLearning · Published 2026-11-19 · 3 min read

Build Your First Shopify Section Step by Step (Liquid for Beginners)

Create a simple editable Shopify section from scratch: HTML, Liquid settings, schema and a preset, then add it in the theme editor.

Share with Shopify developers — useful guides spread faster in theme dev communities.

What you will build

A "Welcome banner" section with a heading, text and a button. Merchants will be able to change every part in the theme editor without touching code.

Step 1: Create the file

  1. In Shopify admin go to Online Store, Themes.
  2. On a duplicate of your theme choose Edit code.
  3. Under Sections, click Add a new section and name it welcome-banner.

Step 2: Write the markup with settings

<section class="welcome">
  {% if section.settings.heading != blank %}
    <h2 class="welcome__title">{{ section.settings.heading | escape }}</h2>
  {% endif %}
  {% if section.settings.text != blank %}
    <p class="welcome__text">{{ section.settings.text | escape }}</p>
  {% endif %}
  {% if section.settings.button_label != blank %}
    <a class="welcome__button" href="{{ section.settings.button_link }}">{{ section.settings.button_label | escape }}</a>
  {% endif %}
</section>

Each section.settings.something reads a value the merchant types in the editor. The if blocks hide empty elements, and escape keeps the page safe.

Step 3: Add the CSS

{% style %}
  #shopify-section-{{ section.id }} .welcome { padding: 48px 20px; text-align: center; background: {{ section.settings.background }}; }
  #shopify-section-{{ section.id }} .welcome__button { display: inline-block; padding: 12px 24px; background: #111827; color: #fff; border-radius: 8px; text-decoration: none; }
{% endstyle %}

Prefixing selectors with #shopify-section-{{ section.id }} stops your styles from leaking into the rest of the theme.

Step 4: Add the schema

{% schema %}
{
  "name": "Welcome banner",
  "settings": [
    { "type": "text", "id": "heading", "label": "Heading", "default": "Welcome to our store" },
    { "type": "textarea", "id": "text", "label": "Text", "default": "Free shipping on orders over $50." },
    { "type": "text", "id": "button_label", "label": "Button label", "default": "Shop now" },
    { "type": "url", "id": "button_link", "label": "Button link" },
    { "type": "color", "id": "background", "label": "Background", "default": "#f1f5f9" }
  ],
  "presets": [{ "name": "Welcome banner" }]
}
{% endschema %}

The presets entry is what makes the section appear in the Add section list.

Step 5: Use it

  1. Click Customize on the duplicate theme.
  2. Choose Add section and pick Welcome banner.
  3. Change the text and colour and watch the preview update.

The shortcut

Writing all this by hand is great practice. When you want to move faster, paste plain HTML into the HTML to Liquid converter. It writes the settings, schema and scoped CSS for you, and you can read the result to learn.

Takeaway

A section is markup plus settings plus schema. Learn more in Shopify Section Schema Explained and the Shopify schema guide.

Need a hand?

If you get stuck, our senior Shopify developers Nishad Kikani and Dhruv Goyani can help. Send your question through the contact form (name, email, subject and message) and describe what you want to build. You can also read about them on the Meet the founders page.

If it does not work: troubleshooting

  • The section is not in "Add section": the schema is missing a presets entry, or the JSON is invalid.
  • A field changes nothing in the preview: the setting id in the schema differs from the one used in the markup. Check spelling and underscores.
  • An image does not show: wrap it in a check for blank and confirm an image is selected in the editor.
  • Styles look different from the design: the theme's CSS is overriding yours. Scope your rules with the section id.

Level up: three extension exercises

  1. Add a color setting for the background and use it in your CSS.
  2. Add a range setting that controls the vertical padding.
  3. Turn the single button into repeatable blocks so merchants can add two or three.

Each exercise teaches one new setting type, and together they cover most of what real sections need.

Topic cluster

Shopify Sections

OS 2.0 sections, JSON templates, and section architecture.

Convert your HTML to Shopify Liquid

Paste a module, generate Liquid + schema, then copy the result into your theme. Free to try—no signup required for a sample conversion.

Share

Share this guide

Found this guide useful? Share it with other Shopify developers on LinkedIn, X, or Reddit.