Learn
A guided track from native JavaScript to a working theme feature.
A guided path for developers who know native JavaScript. Read the pages in order: each one adds a single idea, shows it running in the engine, and ends with something to try.
A theme is a small app you own; the engine supplies its pages, data loading and the connection to Salla.
2. From document.createElement to JSXThe same product card built with DOM calls and with JSX, side by side, and the few rules JSX adds.
3. Components and propsA component is a function that returns JSX, props are its arguments, and the engine's ProductCard works the same way.
4. What a hook isFunctions whose name starts with use: what they give a component, and the two rules for calling them.
5. State and re-renderingWhy React runs your component again, how to watch it happen, and how engine hooks follow data that changes outside React.
6. Server rendering and hydrationEvery page runs twice, on the server then in the browser: what exists where, and how to avoid "window is not defined".
7. The provider: data every component can reachContext shares values without passing props; TwilightProvider shares the store, theme and language, and useTwilight reads them.
8. Reading store dataBuild a small store header one hook at a time with useStore, useTheme, useAsset and useTranslation.
9. Money, dates and numbersFormat prices, dates and digits the way the store and the page language expect, with useMoney, useDate and useNumber.
10. Translations and right-to-leftShow text in the page language with t(), and build layouts that flip correctly between Arabic and English.
11. URLs, routes and pagesHow an address becomes a page, how a component tells which page it is on, and how to add routes of your own.
12. Loading data with loaders and queriesFetch store data before a page renders with a loader, or from a component with useQuery, sharing one cache.
13. Changing data in the browser: the Salla SDKAdd to cart and other actions go through window.Salla in the browser; listen to its events and clean up after yourself.
14. Adding content without editing a page: hook slotsEngine pages leave named slots; register a function for a name and what it returns appears on every page with that slot.
15. Swapping a component: the registryReplace the engine's product card everywhere by registering your own component under product:card.
16. Page titles and SEOSet the title, description and share tags in a page's head, with a route's head function and withHead.
17. Putting it together: a free-shipping progress barCombine a theme setting, money formatting, translations, cart events and a hook slot into one feature.