DESIGN SYSTEM
Token-driven, theme-aware design system. 18 themes, runtime switching via CSS variables, and a terminal-inspired aesthetic. Never hardcode colors.
[COLOR TOKENS]
All colors come from semantic CSS variables. Never use Tailwind color utilities like bg-blue-500 — always use tokens so components adapt to theme switching.
text-foregroundtext-muted-foregroundtext-primarytext-destructivetext-card-foreground// ✅ Adapts to all 18 themes
className="bg-primary text-primary-foreground"
className="bg-card border-border"
className="text-muted-foreground"
// ❌ Hardcoded — breaks theme switching
className="bg-blue-500 text-white"
className="bg-gray-100 text-gray-900"[TYPOGRAPHY SCALE]
Terminal aesthetic uses monospace font via mode.font. Apply it to headings, labels, buttons, and badge text. Body text uses the default sans-serif.
H1 PAGE TITLEH2 SECTIONH3 SUBSECTIONBODYSMALL / HELPERCODELABEL / BADGEBUTTONimport { mode } from '@fabrk/design-system'
import { cn } from '@fabrk/core'
// Headlines + labels → mode.font (monospace)
<h1 className={cn("text-2xl font-bold uppercase", mode.font)}>
PAGE TITLE
</h1>
// Badges + status labels
<span className={cn("text-xs uppercase", mode.font)}>[ACTIVE]</span>
// Body text → no mode.font needed (default sans)
<p className="text-sm text-muted-foreground">
Description text here.
</p>[THE MODE OBJECT]
mode from @fabrk/design-system is the primary interface for theme-aware styling. It exposes Tailwind class strings that update with the active theme.
mode.radiusrounded-dynamicBorder radius — apply to every full-border elementmode.fontfont-bodyFont family — apply to headings, labels, buttonsmode.textTransformuppercaseText transform — uppercase for terminal aestheticimport { mode } from '@fabrk/design-system'
import { cn } from '@fabrk/core'
// Full border card — needs mode.radius
<div className={cn("border border-border bg-card p-4", mode.radius)}>
// Heading — needs mode.font
<h2 className={cn("text-lg font-bold uppercase", mode.font)}>
[SECTION TITLE]
</h2>
// Button — needs both
<button className={cn(
"border border-primary bg-primary text-primary-foreground px-4 py-2 text-xs font-bold uppercase",
mode.font, mode.radius
)}>
{'>'} SUBMIT
</button>[BORDER & RADIUS RULES]
The most common source of visual bugs. Follow these rules exactly.
<Card className={cn("border border-border", mode.radius)}><Card className="border border-border rounded-lg">
<div className="border-t border-border">
<div className={cn("border-t border-border", mode.radius)}><td className="px-3 py-2 border-b border-border">
<td className={cn("px-3 py-2", mode.radius)}><span className="rounded-full">
<span className={cn(mode.radius)}>[TERMINAL CONVENTIONS]
FABRK uses a consistent terminal-inspired text style. Apply these conventions to all UI text, labels, and interactive elements.
[ACTIVE] [STATUS] [v0.2.0] [ON THIS PAGE]> SUBMIT > GET STARTED > SAVE CHANGESTHE FIRST UI FRAMEWORKGet started by installing the package.Something went wrong. Please try again.[18 THEMES]
All themes use the same semantic CSS variables. Switch themes at runtime with setColorTheme() from useThemeContext(). Use the theme switcher in the sidebar to preview any theme on this page right now.
import { useThemeContext } from '@fabrk/design-system'
function MyComponent() {
const { colorTheme, setColorTheme } = useThemeContext()
return (
<button onClick={() => setColorTheme('cyberpunk')}>
Switch to CYBERPUNK
</button>
)
}
// Wrap your app in ThemeWrapper (already done in layout.tsx)
// Theme persists to localStorage via storageKey[QUICK REFERENCE]
- Use semantic tokens:
bg-primary,text-foreground - Add
mode.radiusto full-border elements - Add
mode.fontto headings, labels, buttons - UPPERCASE button text with
>prefix - UPPERCASE labels in
[BRACKETS] - Use spaces in labels:
[API KEY]
- Hardcode colors:
bg-blue-500,text-white - Add
mode.radiusto partial borders or table cells - Use
rounded-lgdirectly (bypass mode.radius) - Use underscores in UI text:
[api_key] - Mix theme tokens:
bg-green-900with semantic tokens