BlogGetting startedReact edition
How to run the Palatian React edition
Build the HTML edition once, then install, generate and start the React 19 app in the react folder. How the shell, the engine bridge and the generated pages fit together, and what the host needs for deep links.

The react/ folder is the same admin as a React 19 single-page app, built with Vite and React Router. It shares the stylesheet, the icon fonts and the engine with the HTML edition, so the two look and behave the same. It needs Node.js 20 or newer, like the HTML build.
Steps
- Build the HTML edition once. The React app copies the stylesheet, fonts and icons from
dist/:cd palatian-v1.5.0 npm install && npm run build - Install and generate the React app:
cd react npm install npm run generate # converts dist/*.html into src/pages/*.jsx, writes routes and nav, copies assets - Start it:
npm run dev # http://localhost:5174 npm run build # production build in react/dist npm run preview # serves react/dist on port 4174 npm test # builds, serves and checks every route in Chromium
How it is put together
| File | Role |
|---|---|
src/shell/ | The persistent chrome as components: Dock, Panel, Toolbar, Footer, CommandBar and Inspector, with useDock() for the section, pin and overlay state and useRouterLinks(), which turns the template's plain page.html links into client-side navigation. |
src/engine.js | Imports the shared engine from ../src/js through the @engine alias and exposes it as window.Palatian, exactly as in the HTML edition. bootShell() runs once, scanPage() after every route render and releasePage() destroys the charts that left the DOM. |
src/hooks/usePageEngine.js | Call it at the top of any page component. It scans the page for data-pl-* automations, forms and declarative charts, and runs an optional init such as a dashboard's chart init. |
src/pages/*.jsx | One component per page, generated from the built HTML by scripts/generate.mjs. Regenerate after you change the HTML, or treat the files as your own and edit them directly. |
src/routes.generated.js, src/nav.generated.js | The route table with lazy-loaded pages and the navigation config. |
public/assets/ | palatian.min.css, palatian.rtl.min.css, the icon fonts and the avatars, copied from the HTML build. Nothing is bundled twice. |
Theme, preferences and RTL
window.Palatian.prefs, setTheme, setScheme and the Theme settings page work unchanged. A small script in react/index.html applies the stored preferences before React mounts and swaps in the right-to-left stylesheet when the stored direction is rtl, so there is no flash. See changing the mode, scheme and direction.
Things to know
- Bootstrap's data API (dropdowns, modals, offcanvas, tabs, collapse) works on React-rendered markup because it listens on
document. Tooltips are created byscanPage(). - Inputs are rendered uncontrolled, with
defaultValueanddefaultChecked, so the demo markup stays editable. Wire your own state where you need it. - Deep links need the host to serve
index.htmlfor unknown paths, the usual single-page-app rewrite rule. Without it, a page refreshed at/ordersreturns the server's 404.
To add a page of your own, see adding a page to Palatian.