Getting started
Everything you need to use, customise and ship Rallyium.
What is inside
Quick start
A Next.js project. Install Node.js 20.9 or newer, then:
npm install
npm run dev # http://localhost:3000, reloads as you edit
npm run build # static export in out/ - upload it to any web server
npm run preview # serve out/Folder structure
rallyium/
├── package.json, next.config.ts, tsconfig.json
├── app/
├── (site)/ layout.tsx, page.tsx, admin/, components/ ...
└── (...)/ pages with another body class or direction
├── components/ Document.tsx, TemplateChrome.tsx
├── lib/site.ts shared head data
├── styles/ ui.css, theme.css, template.css, effects.css
└── public/assets/ js (UI library), imgChange colours, fonts and corners
Everything visual comes from the tokens in assets/css/theme.css. Change a value and every page follows:
:root {
--wt-primary: #4dcb91;
--wt-primary-rgb: 77, 203, 145;
--wt-secondary: #6cd760;
--wt-accent: #ed241d;
--wt-radius: 0.125rem;
--wt-font-heading: "Syne", system-ui, sans-serif;
}Dark mode: the moon button switches data-ui-theme on the <html> element and remembers the choice. Set data-ui-theme="dark" in the markup to make dark the default.
Style guide: the style guide page shows every colour with its contrast, the type, corners, components and the pictures of this template.
Design tokens: design-tokens/tokens.json has the same colours (light and dark), fonts, corners, spacing and shadows in the W3C Design Tokens format - import it into Figma with the Tokens Studio plugin, or build tokens for other platforms with Style Dictionary. design-tokens/tokens.css has them as plain CSS variables for other projects in the same brand.
Charts
The dashboard charts are drawn by Chart.js 4.5.1: tooltips on hover and touch, theme colours that follow the light/dark modes and the colour switch. Each chart is an SVG picture first (so it shows without JavaScript and in print) that carries its numbers in data-wt-chart; assets/js/charts.js turns it into a Chart.js chart. Your own chart:
<div data-wt-chart='{"type":"bar","labels":["Mon","Tue","Wed"],
"series":[{"name":"Visits","data":[120,180,150],"color":0}]}'></div>Types: line, bar, doughnut, radar and bubble. A series colour is a theme colour number (0 primary, 1 accent, 2 secondary, 3 info, 4 warning, 5 success, 6 danger) or any CSS colour. Charts added by your own script start with Charts.init(document).
How the Next.js version works
Next.js App Router with React 19 and TypeScript: one page per route, a client component for the template chrome, static export to out/. Run npm install and npm run dev.
- Every page is a React Server Component in
app/(app/(site)/admin/orders/page.tsxis/admin/orders/); page links usenext/link. - Pages with another body class or text direction live in their own route group with a root layout, so the HTML of every page is complete before any script runs.
components/TemplateChrome.tsx(a client component) handles the theme modes, sidebar, code tabs and copy buttons, and starts the template UI library (public/assets/js/ui.js,data-ui-*attributes) after every navigation.- Icons: Bootstrap Icons font. Fonts: Google Fonts (Syne, Karla).
Menus
The admin menu of this template is Right sidebar - The sidebar sits on the right; it collapses to icons with tooltips. All menus are driven by assets/js/menu.js (no dependencies, the same in every stack):
- Collapsed menu: the collapse button turns the sidebar into icons; every icon shows its name in a tooltip on hover and on keyboard focus, and a menu group opens as a flyout panel.
- Page finder: the search box in the admin top bar (or Ctrl + K) lists every page of the menus; type, use the arrow keys and press Enter.
- Phones: every admin layout opens the full menu as a drawer from the menu button.
- Colour switch: the paint bucket in the admin top bar switches the whole theme to one of 8 colour presets (remembered); a link with
?primaryPreset=tealopens a page in that colour and?primaryPreset=defaultbrings back the template colours. Presets live inassets/js/theme-init.js. - Attributes you can reuse:
data-wt-tip="Label"(tooltip),data-wt-sub="#id"(menu group),data-wt-flyout="#id"(flyout panel),data-wt-pane="#id"insidedata-wt-panes(tabs),data-wt-palette(page finder) anddata-wt-toggle="#id"(full-screen menu).
Browser support
| Browser | Supported versions |
|---|---|
| Chrome | Last 2 versions (111+) |
| Edge | Last 2 versions (111+) |
| Firefox | Last 2 versions (113+) |
| Safari (macOS, iOS) | 16.4+ |
| Opera | Last 2 versions (97+) |
Older browsers still show every page; only newer effects (such as @property animations) fall back to static styles.
Credits
- Next.js - MIT licence
- React - MIT licence
- Chart.js - MIT licence
- Bootstrap Icons - MIT licence
- Google Fonts - SIL Open Font License
- All illustrations in
assets/imgare original SVG artwork made for this template; their subjects are Bootstrap Icons shapes (MIT).