The manifest
Everything a merchant can change, and everything the platform needs to run a theme, is declared in its manifest. The platform validates it before a theme version can reach a merchant, so validate it yourself first: the JSON Schemas are the same ones the platform uses.
Layout
Section titled “Layout”theme.yaml identity, runtime, templates, global settingssections/*.yaml one file per section; the filename is its idlocales/*.json the theme's own strings, one file per localeassets/ static files, served under /_theme/Only theme.yaml is required. A theme with no sections runs, but a merchant
cannot customize it.
theme.yaml
Section titled “theme.yaml”# yaml-language-server: $schema=https://kaladan.dev/contracts/theme/v1/theme.schema.jsoncontract: theme/v1id: golnar # permanent: it keys every merchant's settingsversion: 1.0.0 # semver; a shop pins an exact versionpublisher: your-studio
name: fa-IR: گلنار en: Golnardescription: fa-IR: قالبی روشن برای فروشگاههای صنایعدستی en: A light theme for handicraft shops
storefrontApiVersion: "2026-10"capabilities: [RTL, MULTI_LOCALE, PRODUCT_REVIEWS]
templates: index: name: { fa-IR: صفحهی اصلی, en: Home } sections: [hero, featured-collection, rich-text] default: [hero, featured-collection] product: name: { fa-IR: صفحهی محصول, en: Product } sections: [product-detail, rich-text] required: [product-detail] default: [product-detail]
chrome: header: sections: [announcement-bar, main-header] required: [main-header] default: [main-header]
settings: - group: { fa-IR: رنگها, en: Colours } settings: - id: colorAccent type: color label: { fa-IR: رنگ تأکید, en: Accent } default: "#c8a45c"The first line lets any editor with the YAML language server check the file as you type.
| Field | |
|---|---|
contract | Always theme/v1. A breaking change to the contract would be theme/v2, run side by side. |
id | Lower-case and hyphenated. Permanent: it keys the merchant’s settings document. |
version | Semver. A shop pins an exact version and upgrades only when the merchant chooses to. |
publisher | Your handle. |
name, description | Localized maps. A merchant reads them in the theme picker. |
storefrontApiVersion | The API version the theme queries, pinned for the life of this theme version. |
capabilities | What the theme delivers: RTL, LTR, MULTI_LOCALE, APP_BLOCKS, PRODUCT_REVIEWS, PREDICTIVE_SEARCH, FACETED_FILTERS, PWA, PICKUP_IN_STORE, OFFICIAL_INVOICE. Claim only what ships: merchants choose by it. |
templates | Which pages the theme renders. Required. |
chrome | The header and footer, edited like a template. Optional. |
styles | Named looks: preset settings and layouts. Optional; the first is the default. |
settings | Theme-wide settings, in groups. |
runtime | How the container runs: timeouts, concurrency, memory. See Running a theme. |
network.egress | Hosts the theme may call besides Kaladan, each with a reason. |
migrations | Renamed or dropped setting ids across major versions. |
Templates
Section titled “Templates”A template’s key is a route type: index, product, collection, category,
page, blog, article, search, cart, order, account, policy,
not_found. Each says three things:
sections— the menu the editor offers on that page;required— sections a merchant cannot remove (a product page without the product is a broken shop);default— what the page starts as, in order, before anyone opens the editor.
order is the order-status page a buyer lands on after paying. Its route
carries a token that is a credential, so it is the one page whose response must
never be cached.
Styles
Section titled “Styles”A style is a named starting point made only of settings and layouts. When the theme renders, each value comes from the first of these that has it: the merchant’s own document, then the style, then the default you declared.
styles: - handle: light name: { fa-IR: روشن, en: Light } - handle: bold name: { fa-IR: پررنگ, en: Bold } settings: { colorAccent: "#1a2b6d" }sections/*.yaml
Section titled “sections/*.yaml”Each section is a file. Its filename is its id.
# yaml-language-server: $schema=https://kaladan.dev/contracts/theme/v1/section.schema.jsonname: { fa-IR: بنر اصلی, en: Hero }limit: 1 # once per pageappBlocks: true # a merchant may drop an app's block in here
settings: - id: heading type: text label: { fa-IR: عنوان, en: Heading } default: { fa-IR: تازههای بهار, en: New this season } maxLength: 80 - id: image type: image label: { fa-IR: تصویر پسزمینه, en: Background image }
blocks: - type: button name: { fa-IR: دکمه, en: Button } limit: 2 settings: - id: label type: text label: { fa-IR: متن دکمه, en: Label }
presets: - handle: full-bleed name: { fa-IR: تمامعرض, en: Full width }Setting types
Section titled “Setting types”| Kind | Types |
|---|---|
| Values | text, textarea, richtext, number, range, checkbox, select, radio, color, image, video, url, font |
| Pickers | product, collection, category, page, blog, article, metaobject |
| Editor only | header, paragraph (labels in the form; they hold no value) |
visibleIf hides a control in the editor when another setting has a given
value. It only hides the control: the value still reaches the theme.
Rendering what the merchant arranged
Section titled “Rendering what the merchant arranged”The merchant’s choices arrive as a settings document in the render context. A theme must:
- render sections in the merchant’s order;
- skip a section type it does not know rather than fail the page;
- render the
htmlit is given for a block it does not know, which is how app blocks will arrive; - treat no
sectionslist (“never arranged”: usedefault) differently from an empty one (“deliberately emptied”: render nothing); - mark every section and block it renders with
data-ka-sectionanddata-ka-block, which is how the editor finds them.
Setting ids are a contract
Section titled “Setting ids are a contract”A setting’s id is a key in every merchant’s saved document. Within a major
version it never changes. Across major versions, declare what moved:
migrations: - fromVersion: "1" rename: hero.heading: hero.title # <section>.<setting>, old to new global.headerLayout: main-header.layout drop: [hero.legacyBadge]When a merchant upgrades, their values are carried across, and anything that could not be is reported to them rather than deleted.
Locales
Section titled “Locales”Every merchant-visible string in the manifest is a map keyed by BCP 47 tag.
The theme’s own strings (“Add to cart”, “Out of stock”) live in
locales/<tag>.json. Ship fa-IR, and keep every locale file’s keys the same.