---
title: "RUI theming"
description: "How RUI themes are defined as data, registered with the theme SDK and projected onto the shell."
url: "https://rumahl.com/design/docs/rui-theming"
section: "OS design system"
group: "RUI"
updated: "20 October 2026"
---

# RUI theming

> How RUI themes are defined as data, registered with the theme SDK and projected onto the shell.

**Area:** OS design system  
**Group:** RUI  
**Updated:** 20 October 2026  
**Reading time:** 5 min  
**HTML:** https://rumahl.com/design/docs/rui-theming

## Theme model

A theme is data: a validated set of tokens, optional CSS and safe templates. It is not arbitrary JavaScript and it does not replace shell behaviour.

- id, name and supported modes
- Token values for colour, material, shape, motion, typography, layout and texture
- Optional theme-specific CSS
- Safe slot templates where a theme may provide structure

## Example

```ts
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"]
}));
```

## Runtime

- ThemeProvider projects the active tokens onto the document root.
- The shell resolves the theme from account and device preferences.
- A theme switch produces a new configuration revision and stylesheet.
- Components only read tokens, so no component rebuild is needed.

## Reference

The Storybook theme toolbar and the theme guides demonstrate the active token set and registered themes.
