Skip to content
Hekana Spray
Documentation
Getting started
Theme development
Components and tags

Localization

Apps and custom code

Examples and recipes
API reference
Publishing
Build apps
AI development

Theme structure

Every folder and file in a Sneferu theme: theme.json, layout, templates, sections, blocks, snippets, assets, locales and size limits.

On this page
code
my-theme/
├── theme.json              manifest (required)
├── layout/
│   └── theme.snf           page frame (required)
├── templates/
│   └── index.snf           home page (required); one file per page type
├── groups/<name>.json      first content of the shared header, footer, announcement
├── sections/*.snf          page parts merchants add, reorder and configure
├── blocks/*.snf            repeatable items inside a section
├── snippets/*.snf          partials for {% render %}
├── assets/                 css, js, images, fonts
├── locales/
│   └── en.json             UI strings, one file per locale
└── migrations/*.json       settings migrations (reserved)

node_modules/, dist/, .git/, .sneferu-dev/ and .DS_Store are ignored by the CLI, and so are, at the top of the folder only, package.json and lock files, README.md, LICENSE, CHANGELOG.md, AGENTS.md, CLAUDE.md and a docs/ folder (for notes, screenshots and AI agent instructions). None of these is checked or pushed. Anything else in the folder is part of the theme and is checked.

Files and what they are for

PathRoleNotes
theme.jsonIdentity, version, design tokens, theme-wide settingsSee the field table below
layout/theme.snfWraps every page: header, footer, and <hk-slot name="content" /> where the page goesExactly this file name
templates/<name>.snfA page type. Usually <hk-sections /> plus a <hk-schema> listing the default sectionsindex is required. Also product, collection, search, cart, page, 404 (and alternates such as product.codes); a page type you do not write comes from the SDK's default store. See Page types
groups/<name>.jsonThe sections a store starts with in a shared group (header, footer, announcement)See Section groups
sections/<type>.snfA section type. File name = type (sections/hero.snf is type hero). Has a <hk-schema> with name and settingsRendered inside <div data-hk-section="<id>">
blocks/<type>.snfAn item a merchant can add inside a section (a quote, a slide, a feature)Rendered inside <div data-hk-block="<id>">
snippets/<name>.snfA reusable partial, no schema{% render 'name', key: value %}
assets/CSS, JS, images, fonts: .css .js .png .jpg .jpeg .webp .avif .gif .svg .woff .woff2 .ttf .otf .icoThe only folder that may have sub-folders. assets/*.css is the theme stylesheet. Font files are accepted but not served on the store: use tokens.fonts
locales/<xx>.jsonFlat { "key": "text" } maps, values strings onlyUsed by t('key') and | t
migrations/*.jsonSettings migrations between theme versionsAccepted, not used yet

Section, block and snippet file names may not start with hk- (SN3043): that prefix is reserved for the default store's own sections, blocks and snippets, which a theme borrows under hk-<name>.

A minimal layout:

html
<header class="site-header">
  <hk-container><a href="/" class="logo">{{ store.name }}</a></hk-container>
</header>
<main><hk-slot name="content" /></main>
<footer class="site-footer">
  <hk-container><hk-text text="{{ store.name }}" size="14" /></hk-container>
</footer>

A template:

html
<hk-sections />
<hk-schema>{"sections":[
  {"type":"hero","settings":{"title":"Welcome"}},
  {"type":"featured"}
]}</hk-schema>

<hk-slot> and <hk-sections /> are allowed only in the layout and in templates (SN2011).

theme.json

json
{
  "id": "nile-fashion",
  "name": "Nile Fashion",
  "description": "A theme for clothing stores",
  "version": "1.0.0",
  "author": "Hekana",
  "category": "fashion",
  "engine": "hk2",
  "engineCompatibility": "^2.0.0",
  "defaultLocale": "en",
  "locales": ["en"],
  "settings": {
    "accent": { "type": "color", "label": "Accent", "default": "#B45309" }
  },
  "tokens": {
    "colors": {
      "primary": "#111827", "secondary": "#1F2937", "accent": "#B45309",
      "background": "#FFFFFF", "text": "#111827", "muted": "#6B7280"
    },
    "layout": { "contentWidth": "1200px" }
  }
}
FieldRequiredRuleError
idyes3-41 characters, lower-case letters, digits, -, starts with a letter. Equals the package slug you push toSN3012
nameyesa string, e.g. "Nile Fashion"SN3013
descriptionyesa stringSN3016
versionyesx.y.z. Bump it for every push; a pushed version cannot be replacedSN3014
authoryesnon-empty stringSN3015
categoryyesnon-empty string (general, fashion, electronics, …)SN3017
engineyesexactly "hk2"SN3010
engineCompatibilityyes^2.0.0 or an exact version; must include the current engine 2.0.0SN3011
defaultLocaleyes"en" or "ar"SN3018
localesyesarray that includes defaultLocale, e.g. ["en"]SN3018
settingsyesobject of fields (may be {}), same field format as sections. Merchants edit these for the whole theme; read them as settings.accent or settings('accent'). The id checkout is reservedSN3021, SN3048
tokens.colorsyesprimary, secondary, accent, background, text as #RRGGBB. Extra keys (muted, border, …) are allowedSN3019
tokens.layout.contentWidthno"<3-4 digits>px", e.g. "1200px", or "full"; becomes --hk-content-width (none for full, plus --hk-gutter). Default 1280pxSN3059 (ignored if malformed)
tokens.fontsnoheading, body, mono: font families from the catalogue (see Fonts)SN3032
money.formatno"decimal" (default, 1,290.00) or "whole" (1,290, two decimals kept when there are piastres): the default for money, <hk-price> and product cards (see Money formats)SN3033
tokens.radiusnoaccepted in the manifest, not turned into CSS yet
previewsnoarray of preview image names
checkoutnobranding for Hekana's own checkout: colours, font, radius, button shape, logo, header and footer, trust note (see Checkout branding)SN3049–SN3057 (warnings)

Labels and names (name, description, every setting label, section and block names) are plain strings. Arabic labels are optional: you may write { "en": "Accent", "ar": "…" }, and when ar is missing merchants see the en label.

How tokens become CSS variables is in chapter 5.

Locales

json
// locales/en.json
{ "shop_now": "Shop now", "view_all": "View all" }
  • Keys are flat; every value must be a string (SN3025). No nesting, no plurals.
  • A missing key falls back to the default locale's file, then to the key itself.
  • Put interface words (buttons, empty states, labels) in locales. Put content the merchant should change (titles, descriptions) in section settings instead.

Names and paths

  • File and folder names: lower-case letters, digits, ., _, -; must start with a letter or digit. A name that starts with _ or . (such as assets/_old/) is rejected: rename it. No spaces, upper case, .., absolute paths, backslashes or symlinks (SN3002).
  • Only the folders above, one level deep (except assets/), with the listed extensions (SN3003). sections/hero/hero.snf is rejected.
  • Template files end in .snf. The older .sneferu still works, and one theme can mix the two, but one name may exist in only one form per folder: sections/hero.snf next to sections/hero.sneferu is an error (SN3044).
  • Every text file must be UTF-8 (SN3022).

Size limits

LimitValueError
Files per theme400SN3005
Whole theme25 MBSN3006
One asset2 MBSN3007
One template (.snf or .sneferu)300 KBSN3008
All assets/*.css together (checked by the platform on push)512 KBHK2_CSS_TOO_LARGE

Compress images before adding them (WebP or AVIF), and prefer the platform's product images over bundled photos.

Next steps