Skip to content
Select theme
Light
Dark
Auto
Select language
English
فارسی

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.

theme.yaml identity, runtime, templates, global settings
sections/*.yaml one file per section; the filename is its id
locales/*.json the theme's own strings, one file per locale
assets/ static files, served under /_theme/

Only theme.yaml is required. A theme with no sections runs, but a merchant cannot customize it.

# yaml-language-server: $schema=https://kaladan.dev/contracts/theme/v1/theme.schema.json
contract: theme/v1
id: golnar # permanent: it keys every merchant's settings
version: 1.0.0 # semver; a shop pins an exact version
publisher: your-studio
name:
fa-IR: گلنار
en: Golnar
description:
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
contractAlways theme/v1. A breaking change to the contract would be theme/v2, run side by side.
idLower-case and hyphenated. Permanent: it keys the merchant’s settings document.
versionSemver. A shop pins an exact version and upgrades only when the merchant chooses to.
publisherYour handle.
name, descriptionLocalized maps. A merchant reads them in the theme picker.
storefrontApiVersionThe API version the theme queries, pinned for the life of this theme version.
capabilitiesWhat 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.
templatesWhich pages the theme renders. Required.
chromeThe header and footer, edited like a template. Optional.
stylesNamed looks: preset settings and layouts. Optional; the first is the default.
settingsTheme-wide settings, in groups.
runtimeHow the container runs: timeouts, concurrency, memory. See Running a theme.
network.egressHosts the theme may call besides Kaladan, each with a reason.
migrationsRenamed or dropped setting ids across major versions.

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.

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" }

Each section is a file. Its filename is its id.

sections/hero.yaml
# yaml-language-server: $schema=https://kaladan.dev/contracts/theme/v1/section.schema.json
name: { fa-IR: بنر اصلی, en: Hero }
limit: 1 # once per page
appBlocks: 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 }
KindTypes
Valuestext, textarea, richtext, number, range, checkbox, select, radio, color, image, video, url, font
Pickersproduct, collection, category, page, blog, article, metaobject
Editor onlyheader, 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.

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 html it is given for a block it does not know, which is how app blocks will arrive;
  • treat no sections list (“never arranged”: use default) differently from an empty one (“deliberately emptied”: render nothing);
  • mark every section and block it renders with data-ka-section and data-ka-block, which is how the editor finds them.

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.

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.