UI Strategy & Design System
@doc-version: 16.1.0 @last-updated: 2026-01-01 This guide explains Visitaβs UI strategy and design system architecture. It defines how we build interfaces that are civic-appropriate, accessible, performant, and maintainable.Overview
Core Principle: Our UI strategy balances control with efficiency. We own our design, behavior, and accessibility while leveraging proven tools for foundation.
The UI Strategy Question
When designing a UI strategy, youβre deciding:Who controls design, behavior, accessibility, and future change β you, or a library?Every UI strategy exists on this spectrum:
The Four UI Strategies
π₯ Strategy 1: Full UI Framework (Not Recommended for Visita)
Examples: MUI, Ant Design Pros:- Very fast to start
- Lots of pre-built components
- Heavy bundle size
- Highly opinionated design
- Difficult to customize deeply
- Generic βSaaSβ appearance
- β Long-term civic platforms need custom identity
- β Heavy frameworks conflict with performance goals
- β Opinionated designs donβt reflect civic seriousness
- β Difficult to evolve with changing requirements
π¨ Strategy 2: Build Everything Yourself (Not Ideal Alone)
Pros:- Total control over everything
- Lightweight bundle
- Accessibility is extremely difficult to get right
- Reinventing wheels slows development
- Requires significant UI expertise
- β Civic platforms require excellent accessibility
- β Small team canβt maintain all primitives
- β Risk of inconsistent behavior across components
π© Strategy 3: Headless + Utility CSS (Recommended for Visita)
This is the modern, professional approach weβve chosen. Stack:- Radix UI β Behavior + Accessibility foundation
- Tailwind CSS β Styling control
- shadcn/ui β Starter components (copy, not dependency)
- β Full control over design and behavior
- β Accessible by default (Radix handles ARIA, keyboard nav, focus management)
- β No vendor lock-in (we own the code)
- β Scales beautifully with the platform
- β Aligns with civic design principles
- β We control markup and styling
- β We inherit battle-tested accessibility
- β We can refactor without breaking contracts
- β Design reflects civic values, not generic SaaS
π¦ Strategy 4: Design System First (Future Evolution)
This is where weβre heading as we mature:- Design tokens as single source of truth
- Component contracts and APIs
- UI governance and contribution guidelines
- Automated testing and visual regression
Our UI Stack
The Recommended Stack
Why This Stack Works
- You Control Markup β No magic divs or unwanted DOM structure
- You Control Styling β Tailwind utilities, not pre-styled components
- You Inherit Accessibility β Radix handles the hard parts (ARIA, keyboard nav, focus)
- You Can Refactor β Own the code, change what you need
- Civic-Appropriate β No βstartupβ aesthetic imposed by framework
Component Hierarchy
The Three-Layer Architecture
Components are structured by responsibility to prevent spaghetti code:The Golden Rule
UI components must not know business logic. Domain components may use UI components. Never the reverse.Example:
Design Philosophy
Visitaβs UI Must Feel:
- Civic β Serious, trustworthy, institutional
- Calm β Not flashy or attention-grabbing
- Structured β Clear hierarchy and organization
- Neutral β Data-respecting, not emotionally manipulative
- Accessible β Works for all citizens
What We Avoid:
- β Over-rounded βstartup bubblesβ (excessive border-radius)
- β Flashy gradients and animations
- β Loud, attention-seeking visuals
- β Trendy designs that age poorly
- β Engagement-optimized patterns (infinite scroll, pull-to-refresh for its own sake)
Design Principles
- Clarity Over Cleverness β Simple, readable interfaces
- Function Over Form β Beauty emerges from purpose, not decoration
- Consistency Over Novelty β Predictable patterns build trust
- Accessibility Over Aesthetics β If itβs not accessible, itβs not done
- Civic Responsibility Over Engagement β Inform, donβt manipulate
Design Tokens
Foundation Before Components
Design tokens are the atomic design decisions everything else builds on.π¨ Colors (Semantic, Not Aesthetic)
π² Border Radius
π Spacing
Styling Strategy
How We Use Tailwind
Use Tailwind for:- β
Spacing and layout (
p-4,mt-2,grid-cols-3) - β
Colors (
bg-surface,text-muted,border-danger) - β
Responsive design (
md:p-6,lg:flex) - β
Typography (
text-sm,font-medium)
- β Create massive custom CSS files
- β Inline styles everywhere (
style={{ color: 'red' }}) - β Over-abstract class names too early (
classNames="card-primary") - β Create one-off utilities for every variation
Design Token Implementation
Accessibility Strategy
Non-Negotiable for Civic Platforms
What Radix Provides
Radix UI handles the hard parts of accessibility:- Keyboard Navigation β All components work without a mouse
- Focus Management β Proper focus traps and restoration
- ARIA Roles β Correct semantic HTML and ARIA attributes
- Screen Reader Support β Announcements and state changes
- Color Contrast β Meets WCAG AA standards
Our Accessibility Requirements
Every component must support:- β Keyboard navigation (Tab, Enter, Escape, Arrow keys)
- β Focus rings (visible focus indicators)
- β Screen readers (ARIA labels, live regions)
- β High contrast mode (4.5:1 minimum contrast)
- β Reduced motion preferences
Accessibility Checklist
Before shipping a component:- Test with keyboard only (no mouse)
- Test with screen reader (NVDA, VoiceOver, or JAWS)
- Verify color contrast ratios
- Check focus management in modals/dialogs
- Ensure form labels are properly associated
- Test with browser zoom (200%)
Performance Strategy
UI-Level Performance
Ask these questions early:- Is this component above the fold? β Load immediately
- Can this load later? β Lazy load
- Is it static or interactive? β Server vs client component
- Does it have heavy dependencies? β Dynamic import
Tactics
1. Server Components by Default
2. Client Components Only When Needed
3. Dynamic Imports for Heavy Components
4. Skeleton Loaders
Page-Building Rule
Pages Compose, Not Design
A page should orchestrate components, not contain UI logic.UI Governance Rules
Prevent Chaos with Clear Rules
Adopt these rules and enforce them in code review:- No Page-Level Styling β Pages compose, components style
- No Business Logic in ui/ β UI components are dumb
- No State in Layout Components β Layouts are static structure
- No Copying JSX Across Pages β Extract to shared component
- No Component Without Clear Purpose β Every component solves a problem
- Extend, Donβt Fork β Add variants to existing components
- Accessibility First β No component ships without a11y testing
Component Lifecycle
When you need a new component:- Does it belong in ui/, layout/, or domain/?
- Can an existing component be extended?
- What are its states? (loading, empty, error)
- What props does it need?
- Is it accessible?
- Is it performant?
- Does it follow design tokens?
How This Fits Visita
Visita Needs:
- Trust β UI must feel reliable and institutional
- Clarity β Information must be easy to understand
- Seriousness β This is civic infrastructure, not entertainment
- Accessibility β Must serve all citizens
- Scalability β Must grow with the platform
Our UI Strategy Delivers:
- β Calm Design β No flashy animations or trendy effects
- β Structured Layout β Clear information hierarchy
- β Neutral Aesthetic β Data-respecting, not emotionally manipulative
- β Accessible by Default β Radix ensures baseline accessibility
- β Maintainable β Clear separation of concerns
- β Civic-Appropriate β Reflects seriousness of civic intelligence
Summary
Strategy
Architecture
Accessibility
Performance
Next Steps
Status: Active
Applies To: All UI development
Reviewed: January 2026