← Home

Design Principles

The philosophy, patterns, and rules behind Substrate UI.

Core Philosophy

Substrate UI is a neobrutalistdesign system. Neobrutalism draws from raw, unpolished web aesthetics — bold borders, hard shadows, high contrast, and unapologetic visual weight. The result is interfaces that feel tangible and direct.

01
Bold over subtle

Hard pixel-offset shadows, 2px solid borders, and high-contrast colors. Every element should feel deliberate and present.

02
Sharp by default, round by choice

All corners are square (--radius: 0). Add the .with-radius class to opt into 0.5rem rounding.

03
Tokens drive everything

Colors, spacing, typography, shadows, and motion are defined as CSS custom properties. Change a token once and every component updates.

04
Accessible by construction

Every interactive component wraps a Radix UI primitive, inheriting keyboard navigation, focus management, and ARIA attributes for free.

Component Anatomy

Every Substrate UI component follows a consistent visual recipe.

LayerPatternExample
Border2px solid, uses --borderborder-2 border-border
ShadowHard pixel offset from the shadow scale, no blurshadow-md (4px 4px 0 0)
Radius0 by default; 0.5rem with .with-radiusrounded-[var(--radius)]
ColorsSemantic tokens only — never raw hex in componentsbg-primary text-primary-foreground
InteractionShadow reduces and element translates on press (“push down” effect)hover:shadow-none hover:translate-x-[4px]

When to Use Which Variant

Guidance for choosing between component variants.

Button

VariantWhen to use
defaultPrimary call to action — one per section/view
secondarySecondary actions alongside a primary button
outlineTertiary or less prominent actions
ghostDe-emphasized actions, toolbar items
linkInline navigation that looks like a text link

Alert / Badge

VariantWhen to use
defaultNeutral information or status
successPositive outcome or completion
warningCaution — something needs attention
destructiveError, danger, or irreversible action

Spacing Philosophy

All spacing is based on a 4px grid. Use the spacing scale consistently to maintain visual rhythm.

ContextRecommended tokens
Tight internal padding (badges, chips)--spacing-1 to --spacing-2 (4px–8px)
Standard component padding--spacing-3 to --spacing-4 (12px–16px)
Gap between related elements--spacing-4 to --spacing-6 (16px–24px)
Section spacing--spacing-8 to --spacing-12 (32px–48px)
Major layout spacing (hero, page gaps)--spacing-16 to --spacing-28 (64px–112px)

Typography Hierarchy

Three font families serve distinct roles. Use the size scale to establish clear hierarchy.

FamilyTokenUse for
Archivo Black--font-headHeadings, labels, navigation
Space Grotesk--font-sansBody text, descriptions, UI copy
Space Mono--font-monoCode, technical values, token names

Size Guidance

ContextRecommended sizes
Page titles / hero headingstext-4xl to text-6xl (or fluid variants)
Section headingstext-2xl to text-3xl
Sub-headingstext-lg to text-xl
Body texttext-base to text-lg
Captions, labels, fine printtext-xs to text-sm

For responsive headings, use the fluid tokens (--text-3xl-fluid through --text-6xl-fluid) which scale smoothly between breakpoints via clamp().

Color Usage

Always use semantic color tokens. Never use raw hex values in components.

TokenPurpose
--primary / --primary-foregroundPrimary actions, active states, key UI elements
--secondary / --secondary-foregroundSecondary surfaces, alternative backgrounds
--destructiveDanger, delete, irreversible actions
--success / --warning / --info / --errorFeedback and status communication
--muted / --muted-foregroundDe-emphasized content, placeholders, secondary text
--primary-50 to --primary-900Extended palette for gradients, subtle backgrounds, and detailed UI

Every semantic color has a -foreground companion designed for text placed on that color. Both light and dark themes override these tokens automatically.

Shadows & Depth

The shadow scale communicates elevation and interactivity. Larger shadows = more elevated / more interactive.

ContextShadowBehavior
Interactive at rest (buttons, cards)shadow-md (4px)Reduces to shadow-none + translate on hover/press
Static elevated (panels, callouts)shadow-sm to shadow (2px–3px)No state change
High emphasis (dialogs, drawers)shadow-lg to shadow-xl (6px–10px)Overlay context
Subtle / inlineshadow-xs (1px)Minimal lift for inputs, dividers

Accessibility

Substrate UI is built on accessible foundations.

Radix UI Primitives

All interactive components wrap Radix UI, providing keyboard navigation, focus management, screen reader announcements, and correct ARIA attributes out of the box.

Color Contrast

Semantic color pairings (e.g. --primary-foreground on --primary) are designed to meet WCAG AA contrast ratios. See the contrast audit on the Tokens page for the full matrix.

Reduced Motion

All animations and transitions are disabled when the user has prefers-reduced-motion: reduce enabled in their OS settings.

Theme Support

Light and dark themes are fully supported via the ThemeProvider component. The system preference is respected by default.