Docs

Build storefront pages in code

Every page in the Shesha builder is a tree of widgets: layouts like Column and GridView holding elements like Text, Image and buttons. The builder lets you edit that tree two ways: by dragging on the canvas, or by writing it as code. This guide covers the code.

A promotional banner: one container, a heading and a button
<Container className="py-16 px-6 bg-primary">
  <Column className="items-center gap-4">
    <Text className="text-4xl font-bold text-white text-center" semanticsTag="h2">
      Free delivery over R500
    </Text>
    <FilledButton
      label="Shop now"
      onPressed={{ type: "page", route: "/products" }}
      className="bg-white text-gray-900 rounded-full"
    />
  </Column>
</Container>

If you've written React or HTML, this will look familiar. It's JSX, but the tags are Shesha widgets, not HTML. className takes Tailwind-style utility classes, and values like {product.price} pull live data from your store.

Where you write it

  1. Open a page in the builder and find the layer you want in the Layers panel. Clicking an element on the canvas jumps straight to its layer.
  2. Hover the layer and click </>. The code editor opens with that layer and everything inside it, written out as code.
  3. Edit the code. The editor checks it as you type, completes widget names, props and data fields, and underlines anything it can't build, with a message that says how to fix it.
  4. Apply. The canvas updates and the code becomes the layer again.

What's in this guide