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

Playground

Edit a Sneferu section and its settings and see the real compiler and renderer draw it, in English or Arabic, on desktop or phone.

On this page

Edit a Sneferu section and its settings in the browser and see it rendered by the real compiler and renderer.

Start from
Viewport
Language

A heading, text and button over a coloured block. Change the settings, then the markup.

Settings (from the schema)

Preview

Loading the compiler...

What runs in the page

The preview is not a mock. Your browser loads the SDK's own compileTheme and renderPage (the @hekana/sneferu-compiler, @hekana/sneferu-runtime and @hekana/sneferu-components packages) the first time you open this page; no other page on this site loads them. Each change compiles the section inside the starter theme that npx sneferu init creates, renders it as the only section on the home page with sample products, collections and menus, and shows the HTML in a sandboxed frame with scripts turned off.

The code box holds one section file: markup, hk-* tags and an hk-schema block. The settings fields under it come from that schema, so adding or changing a setting in the hk-schema block adds or changes a field. Fields for images, collections and other store data keep their defaults here.

Read the diagnostics

When the section does not compile, the preview keeps the last version that did, and the diagnostics list shows each problem as an SN code, the file with line and column, and the message. The code links to its range on the diagnostics page with the fix.

Language and viewport

The language switch re-renders with the English or Arabic locale files from the starter and sets lang and dir on the preview document, so right-to-left layout is the real one. The viewport switch renders at 1080 or 390 pixels wide, so media queries in your CSS apply.

What is different from a real store

  • Pictures are plain placeholders and fonts are system fonts, because the preview page is not allowed to load anything from the network.
  • Cart and other interactive controllers do not run: the frame has scripts turned off.
  • The preview shows a single section. Use npx sneferu dev to see a whole theme, header and footer included. See the Quickstart.

Open it on an example

Other pages link here with a starting point, for example /playground?preset=hero. The starting points are the starter's own hero, announcement-bar, featured-products and not-found sections. In MDX, the TryIt component makes that link: give it a preset and the link text.

Next steps