Storybook & design system
Run and extend the living reference for rumahl UI (RUI): stories, foundations, patterns, layouts, theming, accessibility and quality checks. RUI is not the website design system.
RUI, not RWDS
The public design documentation lives at /design: RWDS describes the web system, RUI describes the OS system, and /design/systems explains the boundary.
- RWDS: website tokens, editorial layout, docs and marketing surfaces
- RUI: OS shell components, windows, controls, materials and themes
- Storybook: the living component reference for RUI only
This Storybook documents rumahl UI (RUI) for the OS shell and apps. The website uses the separate rumahl Web Design System (RWDS). Do not confuse the two or import one into the other.
Run Storybook
Storybook lives in its own workspace package so it can be extracted together with @rumahl/ui. The root frontend scripts proxy to it.
pnpm --dir frontend install --frozen-lockfile
pnpm --dir frontend storybook
# http://localhost:6006
pnpm --dir frontend build-storybook
What it contains
Component stories live next to their implementation under frontend/packages/ui/src/components. Cross-cutting documentation lives in frontend/packages/storybook/stories. For the separate design-system overview, open /design.
- Design documentation and the component catalog in MDX
- Foundations: colour, typography, shape, spacing, elevation, motion, icons and accessibility
- Components with autodocs generated from component JSDoc and props
- Hooks, patterns, layouts and app-level surfaces
- Guides for getting started, architecture, theming, overrides, quality and contributing
Theming
A theme is data, not code: tokens plus optional CSS and safe slot templates. The shell projects tokens onto the document root as --rumahl-ui-* custom properties, so a theme restyles the whole OS without touching component code.
- color.* — accent, surfaces, text, canvas, panel, outline, shadow
- material.* — blur, saturation, opacity and glass strength
- shape.* — radii and icon sizes
- motion.* — durations and easing
- typography.* — UI and display faces, scale
- layout.*, texture.wallpaper, icon.gradient
import { defineTheme, registerTheme } from "@rumahl/ui/sdk";
export const ocean = registerTheme(defineTheme({
id: "com.example.ocean",
name: "Ocean",
tokens: {
"color.accent": "#0b6ea8",
"color.canvas.background": "#071a24",
"color.panel.background": "#0d2733",
"color.text.primary": "#eaf4f9",
"shape.radius.window": "16px"
},
modes: ["light", "dark"]
}));
Story conventions
- One Name.stories.tsx per component module, title Components/Name.
- Lead JSDoc on the component feeds autodocs.
- Cover default, variants, sizes, hover/focus/disabled/loading, edge cases, floating and glass={false}.
- Prefer native elements and accessible names.
- Associate errors with aria-describedby and aria-invalid.
- No hard-coded colours or radii in component CSS — use tokens.
Quality checks
The a11y addon is installed and violations are treated as errors in autodocs and tests. Visual regression and bundle budgets are configurable extensions, not part of the current required pipeline.
pnpm --dir frontend typecheck
pnpm --dir frontend lint
pnpm --dir frontend test
pnpm --dir frontend build-storybook
Public surface
@rumahl/ui (tokens, themes, sdk, materials) and @rumahl/ui/components are the public surface. Token IDs, component props and event shapes follow semver: add, deprecate, then remove.
Need more context? Read the source or open a discussion with the project.