Skip to main content

UI Design System

The frontend follows a cohesive dark-theme design language inspired by Stripe Dashboard and Linear, built on shadcn/ui components with Tailwind CSS v4.

Design Principles

  1. Information density -- Compliance officers need to see a lot of data at once. The dashboard uses a single-page layout with tabbed sections rather than multi-page navigation.
  2. Visual hierarchy through color -- Risk levels, agent statuses, and case states all use consistent color scales.
  3. Data-first -- Tables, charts, and structured data displays take priority over decorative elements.
  4. Branded portal -- The customer-facing portal uses a separate light theme with configurable branding.

Component Library: shadcn/ui

shadcn/ui components are installed via CLI, not imported as a package dependency:

npx shadcn@latest add button card table tabs

This approach means:

  • Components live in src/components/ui/ as local source files
  • Full control over styling and behavior
  • No version lock to a component library release cycle
  • Tailwind CSS is the only styling dependency

Installed Components (29)

CategoryComponents
Layoutcard, separator, sheet, collapsible, collapsible-panel, surface
Inputbutton, checkbox, input, label, select, textarea, toggle, toggle-group, switch
Data Displaybadge, table, progress, skeleton, tooltip
Navigationtabs, command, popover, dropdown-menu
Feedbackdialog, sonner (toast)
Themingtheme-toggle

Custom Components

ComponentPurpose
JsonViewerWrapper around @uiw/react-json-view with custom dark theme colors
ParticleBackgroundAnimated particle effect using canvas, used on the portal landing page
SurfaceThemed surface/card container primitive
CollapsiblePanelReusable collapsible content panel
ThemeToggleDark/light theme switcher

Color System

Dashboard (Dark Theme)

PurposeColorTailwind Class
Primary accentTealtext-teal-400, bg-teal-500/10, border-teal-500/30
BackgroundSlate 950bg-slate-950
Card backgroundSlate 900/800bg-slate-900, bg-slate-800/50
Text primaryWhite/Slate 100text-white, text-slate-100
Text secondarySlate 400text-slate-400
BordersSlate 700border-slate-700

Risk Severity Scale

SeverityColorUsage
Verified/CleanEmeraldtext-emerald-400, bg-emerald-500/10
LowBluetext-blue-400, bg-blue-500/10
MediumAmbertext-amber-400, bg-amber-500/10
HighOrangetext-orange-400, bg-orange-500/10
CriticalRedtext-red-400, bg-red-500/10

Case Status Colors

StatusColor
ApprovedEmerald
Review PendingAmber
Processing / AwaitingBlue
RejectedRed
EscalatedPurple
FailedRed/Gray

Agent Pipeline Status

StatusColorMeaning
SuccessEmeraldAgent completed successfully
RunningBlue (animated)Agent currently executing
FailedRedAgent encountered an error
ReusedAmberCached result from prior iteration
PendingSlateAgent queued, not yet started

Portal Theme (Light Mode)

The customer-facing portal uses a light theme to differentiate the experience:

PurposeColorNotes
BackgroundWhiteClean, professional appearance
PrimaryBrand-configurableDefaults to #2563EB (blue)
Brand logoConfigurable URLDisplayed in BrandedHeader component
Brand nameConfigurable textDefaults to "Trust Relay"

Portal branding is configured per deployment:

# backend/app/config.py
brand_name: str = "Trust Relay"
brand_primary_color: str = "#2563EB"
brand_logo_url: str = ""

Data Visualization

JSON Data Display

The JsonViewer component renders structured data (evidence, API responses) with syntax highlighting:

// Custom dark theme colors
const theme = {
string: "teal", // #2dd4bf
number: "amber", // #fbbf24
boolean: "emerald", // #34d399
key: "slate", // #94a3b8
background: "transparent",
};

Charts (Recharts)

  • FinancialHealthCard -- Trend sparklines for revenue, assets, equity over time
  • AnalyticsCharts -- Risk distribution bar chart, case status pie chart
  • RiskHeatmap -- Aggregated risk visualization across all cases
  • ConfidenceChart -- Radial confidence score display
  • RiskScoreRing -- SVG ring showing 0.0-1.0 risk score with color gradient

Pipeline Visualization

  • PipelineDAG -- Directed acyclic graph showing agent dependencies
  • AgentCard -- Individual agent status card with model name, duration, findings count
  • PipelineTimingBar -- Horizontal bar chart showing relative agent execution times

Accessibility

What Is In Place

  • Touch targets -- Buttons follow the 44px minimum touch target rule
  • Color contrast -- Primary text on dark backgrounds meets WCAG AA (4.5:1 ratio)
  • ARIA labels -- Present on interactive elements in shadcn/ui primitives
  • Skeleton loaders -- Used instead of spinners for content loading states
  • Toast notifications -- Sonner toasts for async feedback instead of alert boxes

Known Gaps

  • Keyboard navigation -- Some custom components (PipelineDAG, RiskHeatmap) lack keyboard support
  • Screen reader -- Complex data visualizations (charts, JSON viewer) have limited screen reader descriptions
  • Focus management -- Tab panel focus behavior is inconsistent
  • Color-only indicators -- Some status indicators rely on color alone without text or icon alternatives
note

Accessibility improvements are tracked as a production readiness item. The current implementation handles the common paths but has gaps in complex interactive components.

Responsive Design

The dashboard is designed for desktop-first (officer workstations) with basic tablet support:

BreakpointLayout
320px (mobile)Single column, basic support
768px (tablet)Two-column layout
1024px+ (desktop)Full dashboard layout with sidebar and tabs

The customer portal is fully responsive across all breakpoints, as customers may access it from mobile devices.

Golden Standard UI Rules

The following rules from the project's Golden Standard v6 are enforced:

  • shadcn/ui as the component library (not Material UI, not Ant Design)
  • Skeleton loaders for content loading (not spinners)
  • Sonner toasts for async feedback (not alert boxes)
  • No modal dialogs for simple confirmations -- use inline UI or Sheet
  • Minimum 44px touch targets
  • WCAG AA color contrast (4.5:1)
  • Design reference: Stripe Dashboard / Linear