Retain Design System

A comprehensive design language for the Retain iOS app — colors, typography, spacing, and component patterns extracted from the live codebase.

SwiftUI · iOS 17+ · v1.0

Colors

All colors are defined in DesignSystem/Colors.swift and accessed via Color.retain.*

Brand Primary

Primary Light
#7B96DB
Primary
#5A7BCF
Primary Dark
#4A69BD

Warm Accent

Accent Light
#E8956A
Warm Accent
#B85520

Sign-In Gradient (Forest Green)

Gradient Top → Bottom
#3D5A4E → #344A40

Warm Palette (Home)

Warm Background
#FFFFFF
Warm Card
#FBF6F4
Warm Border
#F3EBE7
Warm Divider
#FFFBF9

Neutral Scale

Neutral 50
#FAFAFA
Neutral 100
#F5F5F5
Neutral 200
#E5E5E5
Neutral 300
#D4D4D4
Neutral 400
#A3A3A3
Neutral 500
#737373
Neutral 600
#525252
Neutral 700
#404040
Neutral 800
#262626
Neutral 900
#171717

Semantic Colors

Blue 50
#EFF6FF
Blue 500
#3B82F6
Blue 600
#2563EB
Blue 700
#1D4ED8
Rose 50
#FFF1F2
Rose 500
#F43F5E
Green 50
#F0FDF4
Green 500
#22C55E
Amber 50
#FFFBEB
Amber 500
#F59E0B
Violet 50
#F5F3FF
Violet 500
#8B5CF6
Orange 50
#FFF7ED
Orange 500
#F97316
Red 50
#FEF2F2
Red 500
#EF4444
Purple 50
#FAF5FF
Purple 600
#9333EA
Teal 600
#0D9488

Chat Colors

User Message
#5A7BCF @ 12%
Mention
#5A7BCF @ 15%
Assistant Message
secondaryBg

Typography

Dual-mode system: Charter (serif) for reading surfaces, SF Pro (system) for control surfaces. Defined in Typography.swift, AppFont.swift, StyleConfig.swift.

Type Scale — Control Surface (SF Pro)

Large Title The quick brown fox 34pt · Bold
Title The quick brown fox jumps over 22pt · Semibold
Headline The quick brown fox jumps over the lazy dog 17pt · Semibold
Body The quick brown fox jumps over the lazy dog 17pt · Regular
Callout The quick brown fox jumps over the lazy dog 16pt · Regular
Caption The quick brown fox jumps over the lazy dog 12pt · Regular
Caption 2 The quick brown fox jumps over the lazy dog 11pt · Regular

Type Scale — Reading Surface (Charter)

Charter Roman Conversations become memories, memories become actions. Charter-Roman
Charter Bold Card titles, content headings, emphasis Charter-Bold
Charter Italic Quoted text, secondary emphasis Charter-Italic

Monospace (Code)

JetBrains Mono let greeting = "Hello, Retain" Regular · Bold · Medium

Usage Guidelines

SurfaceFontWhen to Use
ReadingCharterTitles, body text, content headings, card titles, quotes, long-form
ControlSF ProButtons, tabs, pills, badges, metadata, navigation, search, labels
CodeJetBrains MonoCode blocks, technical content, monospaced displays

Spacing

7-step spacing scale defined in DesignSystem/Spacing.swift. All layout uses these tokens exclusively.

xs
4pt
sm
8pt
md
12pt
lg
16pt
xl
24pt
xxl
32pt
xxxl
48pt

Corner Radius

sm
8pt
md
12pt
lg
16pt
xl
22pt
xxl
28pt
bubble
16pt
bubbleTail
8pt

Buttons

Three button styles plus a floating action button. Height: 56pt, corner radius: 16pt. Defined in DesignSystem/RetainButton.swift.

StyleBackgroundText ColorShadow
Primary#3D5A4E → #344A40 gradient + white 20% strokeWhitergba(52,74,64,0.25) · r12 · y4
Secondary#FFFFFFNeutral 900rgba(0,0,0,0.06) · r16 · y4
Destructive#FFFFFFRed 500 (#EF4444)rgba(0,0,0,0.06) · r16 · y4
Compose FAB#B85520Whitergba(184,85,32,0.3) · r12

Button States

StateBehavior
LoadingProgressView spinner replaces/accompanies text, button disabled
Disabled50% opacity, tap disabled
DefaultFull opacity, interactive

Components

Reusable building blocks from the DesignSystem/ and Features/ directories.

RetainCard
Generic content container with padding, rounded corners, and subtle shadow.
RetainCard
Surface-colored container with padding, corner radius, and elevation shadow
DesignSystem/RetainCard.swift
SkeletonView
Shimmer placeholder system — conversation cards, chat messages, empty states
DesignSystem/SkeletonView.swift
⚠️
Something went wrong
ErrorView / LoadingView
Full-screen centered states for loading spinners and error messages with retry
DesignSystem/ErrorView.swift
Review quarterly OKRs
High Product
TaskCardView
Checkbox + Charter title + priority/category badges with color coding
Features/Tasks/TaskCardView.swift
How was my meeting?
Your standup covered 3 action items and a blocker on the API migration.
Chat Bubbles
User (primary @ 12%) and assistant (secondary bg) with 16pt bubble radius
Features/Chat/ChatView2.swift
RR
Ryan Rapp
Pro Member since 2024
ProfileHeaderView
Avatar with initials fallback, name, email, plan badge, membership date
Features/Profile/ProfileHeaderView.swift

Navigation

5-tab bottom navigation with a centered compose FAB. Active state uses warm accent (#B85520).

🏠Home
Memories
✏️
Actions
👤Profile

Navigation Structure

ElementSpec
Tab bar5 items, center is 48pt circular FAB (warm accent), standard tab icons below
Active color#B85520 warm accent
Inactive colorSystem tertiary label
BadgeUnread dot on Actions & Profile tabs; count badge on Actions
RoutingNavigationStack with path-based routing, 10 screen destinations
Back gestureEdge swipe — 60pt trigger zone, 120pt vertical tolerance

Memory Types

9 distinct memory categories, each with a unique icon, color, and background.

Quick Capture
👥
Meeting
🤝
One-on-One
🎙️
Interview
Q&A Session
Action Plan
⚖️
Decision Record
📖
Research Notes
💡
Idea Brainstorm

Badges

Color-coded badge system for task priority and category.

Priority

● High ● Medium ● Low None

Category

Product Finance Engineering Design Personal Research

Icon System

SF Symbols throughout with consistent sizing. No custom icon library — all icons from Apple's system set.

Core Navigation Icons

TabSF SymbolUsage
Homehouse.fillHome tab
MemoriestimelapseMemories tab
Composepencil.lineCenter FAB
Actionsbolt.fillActions tab (with badge)
Profileperson.fillProfile tab

Common Action Icons

ActionSF Symbol
Checkmarkcheckmark / checkmark.circle
Error/Warningexclamationmark.triangle
Playplay.fill
Recordmic.fill / waveform
Meetingperson.2.fill
Chatbubble.left.and.bubble.right.fill
Checklistchecklist
Knowledgebook.fill
Ideaslightbulb.fill

Figma Setup Guide

How to translate these tokens into your Figma design system.

1. Color Variables

Create a Figma Variables collection called Retain/Colors with these groups. Use variable modes for Light/Dark where iOS uses system-adaptive colors.

GroupVariablesNote
Brandprimary, primary-light, primary-darkFixed hex values
Accentwarm-accent, warm-accent-lightFixed hex values
Surfacesurface, surface-secondary, surface-tertiaryLight/Dark modes
Texttext-primary, text-secondary, text-tertiaryLight/Dark modes
Warmwarm-bg, warm-card, warm-input, warm-border, warm-dividerLight mode only
Neutral50 through 900 (10 steps)Fixed hex values
Semanticblue, rose, green, amber, violet, orange, red, purple, teal (50–700 each)Fixed hex values
Chatchat-user, chat-assistant, mentionDerived with opacity
Systemseparator, destructive, success, warningLight/Dark modes

2. Typography Styles

Create two style families. Use Charter (bundled, available in Figma) for reading and SF Pro for controls.

Style NameFontSizeWeight
Control/LargeTitleSF Pro Display34Bold
Control/TitleSF Pro Display22Semibold
Control/HeadlineSF Pro Text17Semibold
Control/BodySF Pro Text17Regular
Control/CalloutSF Pro Text16Regular
Control/CaptionSF Pro Text12Regular
Control/Caption2SF Pro Text11Regular
Reading/BodyCharter17Roman
Reading/Body BoldCharter17Bold
Reading/Body ItalicCharter17Italic
Code/RegularJetBrains Mono14Regular

3. Spacing & Radius Variables

Create a Retain/Spacing number variables collection.

TokenValueUsage
spacing/xs4Tight inline spacing
spacing/sm8Icon-to-text, compact padding
spacing/md12Default internal padding
spacing/lg16Section padding, card padding
spacing/xl24Major section gaps
spacing/xxl32Screen margins, large gaps
spacing/xxxl48Hero spacing
radius/sm8Inputs, small elements
radius/md12Cards, badges
radius/lg16Buttons, chat bubbles
radius/xl22Modals, pills
radius/xxl28Sheets, overlays

4. Component Structure

Create these as Figma components with variants and auto-layout.

ComponentVariantsKey Properties
ButtonPrimary, Secondary, Destructive × Default, Loading, Disabledh56, r16, full-width, headline font
FABDefault48×48 circle, warm accent bg
CardWarm, Simple, Defaultr12, lg padding, subtle shadow
TaskCardBy priority × By categoryCheckbox + Charter title + badges
ChatBubbleUser, Assistantr16 (r8 tail corner), max 85% width
BadgePriority (High/Med/Low) + Category (6 types)Pill shape, border, semantic colors
MemoryBadge9 memory typesIcon + colored background + label
TabBar5 tabs with active statesCenter FAB, warm accent active
SkeletonCard, Message, ListShimmer gradient placeholder
EmptyStateDefaultIcon + title + subtitle + CTA
ErrorStateWith/without retryWarning icon + message + button
ProfileHeaderDefaultAvatar (initials fallback) + info

Code Reference

Quick reference for how tokens are accessed in the SwiftUI codebase.

// Colors Color.retain.primary Color.retain.warmAccent Color.retain.neutral500 // Typography (Control surface) .font(.retain.headline) .font(.retain.body) // Typography (Reading surface) .font(AppFont.charter(14, weight: .bold)) .font(AppFont.charterItalic(16)) // Spacing .padding(Spacing.lg) .padding(.horizontal, Spacing.xl) // Corner Radius .clipShape(RoundedRectangle(cornerRadius: CornerRadius.lg)) // Buttons RetainButton(title: "Save", style: .primary) { save() } RetainButton(title: "Delete", style: .destructive, isLoading: true) { delete() }