How to Build a Custom Section in Shopify (2026)

Last updated
Expert reviewed
5 min read
Jacques Blom
Jacques Blom
CTO at Fudge.

Key takeaways

  • Shopify sections are Liquid files in the sections/ folder with a {% schema %} block defining their settings.
  • Settings defined in the schema automatically appear in the Theme Editor right panel.
  • Add a presets key to the schema to make the section available in “Add section” without manual template editing.
  • Fudge generates complete custom sections from a plain English description — including HTML, CSS, JavaScript, and schema.

Every section in the Theme Editor is a Liquid file with a schema. The schema is what makes it editable without code — it defines which settings appear in the right-hand panel, what type of input each setting is, and what the default values are.

Understanding this structure lets you build anything.

How to create a custom section in Shopify

Step 1 - Duplicate your active theme. Online Store → Themes → three-dot menu → Duplicate.

Step 2 - Open the code editor on the duplicate theme.

Step 3 - Navigate to the sections/ folder.

Step 4 - Click the ”+” or “Add a new section” button. Name your section (e.g., custom-promo-banner). Shopify creates sections/custom-promo-banner.liquid.

Step 5 - Write your section content and schema.


The anatomy of a Shopify section

A section file has two main parts: HTML/Liquid content and a {% schema %} block.

<!-- The visible content -->
<div class="promo-banner" style="background-color: {{ section.settings.background_color }};">
  <div class="page-width">
    <p class="promo-banner__text">{{ section.settings.text }}</p>
    <a href="{{ section.settings.button_link }}" class="button">
      {{ section.settings.button_label }}
    </a>
  </div>
</div>

{% schema %}
{
  "name": "Promo Banner",
  "settings": [
    {
      "type": "text",
      "id": "text",
      "label": "Banner text",
      "default": "Free shipping on orders over $50"
    },
    {
      "type": "color",
      "id": "background_color",
      "label": "Background color",
      "default": "#000000"
    },
    {
      "type": "text",
      "id": "button_label",
      "label": "Button label",
      "default": "Shop Now"
    },
    {
      "type": "url",
      "id": "button_link",
      "label": "Button link"
    }
  ],
  "presets": [
    {
      "name": "Promo Banner"
    }
  ]
}
{% endschema %}

How schema settings work:


Common schema setting types

TypeUse for
textShort text inputs
textareaLonger text
richtextFormatted text with bold/italic
image_pickerLet merchants pick an image
urlLinks and button destinations
colorColor picker
rangeNumber slider (e.g., padding, font size)
selectDropdown with predefined options
checkboxBoolean toggle
htmlCustom HTML input
headerGroup label (not a real setting, just visual)

Adding blocks — repeating elements

Blocks let merchants add repeating content — testimonials, FAQs, feature items. Each block has its own schema.

{% for block in section.blocks %}
  <div class="testimonial {{ block.shopify_attributes }}">
    <p>{{ block.settings.quote }}</p>
    <cite>{{ block.settings.author }}</cite>
  </div>
{% endfor %}

In the schema, add a "blocks" key:

"blocks": [
  {
    "type": "testimonial",
    "name": "Testimonial",
    "settings": [
      {
        "type": "textarea",
        "id": "quote",
        "label": "Quote"
      },
      {
        "type": "text",
        "id": "author",
        "label": "Author name"
      }
    ]
  }
],
"max_blocks": 6

{{ block.shopify_attributes }} is required for the Theme Editor to recognize each block and allow editing.


Making your section appear in “Add section”

The "presets" key in the schema is what makes your section appear in the Theme Editor’s “Add section” menu. Without presets, the section only works if manually added to a template JSON file.

"presets": [
  {
    "name": "Promo Banner",
    "blocks": [
      {
        "type": "testimonial"
      }
    ]
  }
]

The "name" in presets is the label that appears in the “Add section” menu.

Build a custom Shopify section by describing it to Fudge.
Try Fudge for Free

Adding CSS and JavaScript to a section

Use {% stylesheet %} and {% javascript %} blocks at the bottom of the section file (after the schema):

{% stylesheet %}
  .promo-banner {
    padding: 12px 0;
    text-align: center;
  }

  .promo-banner__text {
    font-size: 14px;
    margin: 0 0 8px;
  }
{% endstylesheet %}

{% javascript %}
  // Section-specific JavaScript here
  // Automatically bundled and deferred by Shopify
{% endjavascript %}

Shopify bundles all section stylesheets and scripts automatically — you don’t need to create separate CSS or JS files for simple sections.


Using Fudge to generate custom sections

Building sections manually requires understanding Liquid, JSON schema syntax, and Shopify’s section architecture. Fudge removes that barrier:

“Build a testimonials section with a heading, subtitle, and up to 6 testimonial blocks. Each block should have a quote (text area), author name, author title, and star rating (1-5 range). Show them in a 3-column grid on desktop, 1 column on mobile.”

Fudge generates the complete section file — HTML, schema, CSS, and JavaScript — as a draft for review. No schema hunting, no Liquid syntax errors.

Jacques's signature
Build custom Shopify sections by describing exactly what you need.

You might also be interested in

How to Add a New Section Type in Shopify From Scratch (2026)
Create a brand new Shopify section type — full walkthrough building a testimonials section with blocks, settings, schema presets, and CSS, making it
How to Add Custom JavaScript in Shopify (2026)
Add custom JavaScript to Shopify — use section JS blocks for scoped scripts, theme.liquid for global scripts, or Custom HTML blocks in the Theme
How to Add a Custom Template in Shopify (2026)
Create a custom page template in Shopify — how to make a new JSON template in the code editor, add sections to it, and assign it to specific