Skip to main content
Prefab renders with sensible defaults out of the box: system fonts, automatic gaps between cards, comfortable card padding, and gradient fills on progress bars. No theme is required for a polished look. Themes let you go further: accent colors, custom fonts, dark chrome, data-oriented styling, and — since a theme can restyle every component — total conversions like rendering your dashboard as a Windows 2000 program. In the playground and documentation previews, theme styles stay with the preview and its overlays, so component overrides also reach popovers and dialogs while the surrounding editor or page keeps its appearance. Pass a theme to PrefabApp:

Themes

No theme needed. The base renderer ships with system fonts, automatic gaps between cards, comfortable card padding, and gradient fills. This is what every PrefabApp looks like with no theme argument.
Windows 2000 and MySpace are inspired by Anders Swanson’s mods of Prefab, built for his dashboard bake-off comparing dashboarding tools on the same dbt-fusion issue data. His originals live in dataders/fusion_issue_analysis.

Accent

All themes accept accent, which controls the primary color, focus rings, and chart colors. Pass a Tailwind color name, CSS color string, or OKLCH hue number:
With accent=None (the default), no color overrides are applied and components use the renderer’s neutral zinc palette.

Fonts

font sets the sans-serif typeface. font_mono sets the monospace font. Both auto-import from Google Fonts:
Presentation loads Inter by default, a typeface optimized for screen readability with tabular numerals that keep table columns aligned. The base renderer uses the platform’s system font stack for zero-latency rendering with no font download.

Color Scheme

By default, themes follow the OS preference for light or dark mode. Presentation’s dark slate chrome renders dark regardless of system preference. Override on any theme with mode:

Custom Themes

Theme gives full control. The css field accepts any CSS for component styling, fonts, and overrides:
For color overrides that differ between light and dark mode, use light_css and dark_css:

Variable Reference

Prefab’s CSS variables follow shadcn/ui naming conventions, so output from any shadcn theme generator can be pasted directly into light_css and dark_css.

Themes in the Playground

Themes apply in the playground exactly as in production. The toolbar’s theme picker overrides the code theme when active; selecting “Code” restores whatever your code defines. Presets that force a color scheme keep it across code edits. The light/dark toggle can override the selected preset’s mode; custom CSS does not force a color scheme. Every built-in theme is a picker preset, so any example in these docs can be flipped into Windows 2000 or MySpace without touching its code. The presets are compiled from the Python classes at build time by tools/generate_theme_presets.py, which means the picker and PrefabApp(theme=...) cannot disagree.