style — Default style for pages and widgets
When to use it
Use Numable defaults when the user has not requested a visual style: neutral backgrounds, clear type hierarchy, restrained accents and light/dark colours for tool pages, dashboard widgets and home-screen widgets.
Follow requests for hand-drawn, paper, retro or other styles. Preserve an existing tool's style when editing it unless the user asks to change it. Defaults do not require every tool to look the same and are not a publishing requirement.
Start with a working template
For a tool with both pages and widgets, start with the clock:
numable init my-tool
Its home page shows the actual device time, date and time zone, with an Add widget button inside the app. The page style kit lives in page/assets/numable.css and numable-kit.js, page logic in page/assets/clock.js, and the widget in xWidget/rc/clock.rcn. Replace the clock's content and logic. If no page is needed, remove its route and files.
For a tool focused on data widgets, pick the closest layout:
numable init my-metric --layout big-number
numable docs layouts
There are 12 widget layouts, including big numbers, trends, lists, progress and countdowns. Slots make connecting data quick. For a different visual treatment, edit the RCN colours, typography and composition in place. Check all sizes belonging to the same tool.
Layout packages mainly provide widgets and do not generate a page. To add one, run numable kit apply in the package to write the style kit, then follow numable docs add-page. The clock home page is not a finished home page for a different tool.
The style kit
Page styles come from the style kit: page/assets/numable.css (styles) and page/assets/numable-kit.js (the pickers for dropdowns, dates and times). Load both on every page:
<link rel="stylesheet" href="../../assets/numable.css" />
<script src="../../assets/numable-kit.js" defer></script>
This path fits two-level directories such as page/html/home/index.html. Do not edit these two files; see the next section to change the style.
numable kit check my-tool
numable kit apply my-tool
The latest version lives at https://docs.numable.app/kit/v1/; numable init and kit apply fetch it from there and fall back to the copy bundled with the CLI when offline (--offline uses only the bundled copy). Within v1 only compatible changes are made, so re-applying never breaks an older tool, and class names from the older starter keep working. At runtime pages only read the copy inside the package; nothing is fetched.
| Purpose | Classes |
|---|---|
| Page title and current state | nb-header, nb-dot (tool colour dot), nb-sub, nb-at (freshness, top right) |
| Sections and cards | nb-section, nb-section-head, nb-card, nb-label |
| Metrics and key-value rows | nb-metric, nb-row, nb-row-label, nb-row-value |
| Lists | nb-list, nb-li, nb-li-main, nb-li-title, nb-li-sub, nb-li-value, nb-chev |
| Buttons | nb-btn, variants nb-btn--secondary, --plain, --danger, --sm, --block; nb-btns side by side, nb-actionbar pinned to the bottom |
| Forms | nb-field, nb-label, nb-hint, nb-input (including select and type=date/time), nb-seg, nb-chips, nb-switch, nb-stepper |
| Loading, empty and failure states | nb-skel, nb-state, nb-state--error, nb-banner, nb-error |
| Sources and privacy | nb-footnote |
A select or a date or time input with class="nb-input" opens the kit's shared picker when tapped; the native control still holds the value and fires change as usual. The display follows along when a script changes .value or .selectedIndex or refills the options; add data-nb-native to keep a control's native picker. For a small dropdown inside a section heading or toolbar, use class="nb-input nb-input--sm" (34 tall, width fits the content).
An older page with its own styles that should not switch to the full kit can load just numable-pick.css and numable-kit.js: it only styles the picker controls, inputs and popups, with variables scoped to those controls, and leaves the rest of the page alone. Add nb-input to the controls, and to the page's other form inputs too so the page does not end up with two kinds of input.
These are styling building blocks. Forms still need real save actions and failures need real retry actions. Do not draw an interactive button without wiring it up. Prefer labelled native button, input and label elements.
Default page titles are 24, section headings 13, body text 15 and footnotes 11; horizontal padding is 14 and section spacing 20. Widget titles are usually 13, while primary numbers vary with size. Pages and widgets share text and colour roles. Do not stretch a widget to make a detail page: the page should answer the widget's question at least as completely.
For XPage, implement the same hierarchy with Canvas and container nodes from numable docs xpage. CSS classes only apply to HTML pages.
Customising the style
Colours are injected by the app: buttons, switches, selection and focus use --nb-accent, which follows the accent of the app the tool runs in; neutral colours match the app shell. Put the tool's own colour in --nb-src, used for the title dot and charts but never for buttons:
:root { --nb-src: #D63384; }
:root[data-theme="dark"] { --nb-src: #F06BAA; }
When the user asks for a different style, load your own stylesheet after the kit and override variables:
:root { --nb-accent: #2F6FE4; --nb-on-accent: #FFFFFF; --nb-radius: 18px; }
:root[data-theme="dark"] { --nb-accent: #5C9BFF; --nb-on-accent: #0B0C0E; }
Main variables: --nb-bg page background, --nb-card content surface, --nb-ink primary text, --nb-sub secondary text, --nb-line separators, --nb-tile input fill, --nb-accent accent, --nb-on-accent text on accent, --nb-accent-soft selected surfaces and --nb-src tool colour; sizes --nb-inset horizontal page padding and --nb-radius card radius. Check button text and selected surfaces whenever changing the accent.
RCN does not read CSS. Change corresponding colours in .rcn using light/dark branches separated by |. Default page and widget accents may differ; once a tool has its own accent, apply it consistently to both.
Colours, type hierarchy, spacing, corners and layout are all customisable, and you can skip the kit and write your own styles. Preserve safe areas and container boundaries: HTML needs --xb-content-top and --xb-content-bottom; XPage needs content insets. Read the container's data-theme and follow data-lang and language events; see numable docs bridge.
Home-screen widgets reuse the widget canvas, without a separate stylesheet. Draw the widget background explicitly. The dashboard shell cannot supply it on a home screen, where any wallpaper may be behind it.
Verify and deliver
numable check my-tool
numable run my-tool
numable render my-tool
numable render my-tool --page
Inspect light, dark and empty states. After restyling, check narrow widths, long titles, Chinese and English. Check that primary actions are recognisable, both themes remain readable and page/widget information agrees. Page screenshots check layout; saving, navigation and adding widgets still need actual interaction inside the app.