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.
<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
- 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.
- Hover the layer and click </>. The code editor opens with that layer and everything inside it, written out as code.
- 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.
- Apply. The canvas updates and the code becomes the layer again.
What's in this guide
PrinciplesThe handful of ideas the whole language follows.SyntaxElements, props, text, slots and comments.StylingUtility classes, theme colours and the style prop.Responsive designBreakpoints, prefixes and per-size values.Store dataProducts, categories, brands and collections, live.Lists & conditionsRepeat a template per item; show parts only when they apply.BackticksMix words with data, and switch classes on data.Links & actionsOpen pages, open links and add to cart.SectionsHow every section is just widgets with a name.Widget referenceEvery layout and element you can use.Generating a designIndustry, aesthetic and composition, and what generating changes.Mobile menu, cart & filtersReady-made sheet templates, cart controls and filter options.IconsSearch more than 2,000 icons and use them anywhere.Getting paid and plansPaystack payouts, what each plan includes, and your tab.Shipping with Bob GoDelivery prices at checkout, couriers, waybills and tracking.