RheaKitScientific UI surfaces for SwiftUI

Design System

The visual language behind RheaKit: dark scientific surfaces, semantic status colors, and the GlassCard shell.

Design System

RheaKit's visual language is defined in RheaTheme: one set of tokens for background, emphasis, operational state, and severity. It is deliberately dark-first and data-forward.

Color palette

TokenValueUsage
bgrgb(15, 15, 26)Primary background
cardrgb(26, 26, 41)Panel surface
cardBorderwhite @ 6%Subtle panel outline
accentrgb(102, 217, 255)Primary interactive cyan
greenrgb(77, 230, 128)Healthy, live, success
amberrgb(255, 199, 51)Warning, compact, degraded
redrgb(255, 89, 89)Error, critical, blocked
purplergb(179, 128, 255)Proof and hard-fail emphasis
mutedwhite @ 50%Secondary text
textwhitePrimary text
Text("Online")
    .foregroundStyle(RheaTheme.green)

Text("3 alerts")
    .foregroundStyle(RheaTheme.red)

Rectangle()
    .fill(RheaTheme.bg)

Semantic color functions

modeColor(_ mode: String) -> Color

ModeColor
normalgreen
compactamber
criticalred
hard_failpurple

paceColor(_ pace: String) -> Color

PaceColor
greengreen
yellowamber
redred

priorityColor(_ priority: String) -> Color

PriorityColor
P0red
P1amber
P2accent

statusColor(_ status: String) -> Color

StatusColor
opensecondary
claimedaccent
donegreen
blockedred

GlassCard

.glassCard() is the package's signature shell for compact, dense information surfaces.

VStack {
    Text("Agent: Rex")
    Text("Tokens: 12K")
}
.glassCard()

Implementation:

public struct GlassCard: ViewModifier {
    public init() {}

    public func body(content: Content) -> some View {
        content
            .padding(16)
            .background(
                RoundedRectangle(cornerRadius: 16)
                    .fill(RheaTheme.card)
                    .overlay(
                        RoundedRectangle(cornerRadius: 16)
                            .stroke(RheaTheme.cardBorder, lineWidth: 1)
                    )
            )
    }
}

Typography posture

RheaKit does not hide behind decorative type. It uses monospaced data presentation to keep numbers, pace, and status legible under load.

ContextFont pattern
Section headers.system(size: 10, weight: .bold, design: .monospaced)
Body and payload content.system(size: 12, design: .monospaced)
Badges and status pills.system(size: 9, weight: .bold, design: .monospaced)
Tiny indicators.system(size: 8-9, design: .monospaced)

Design rules that matter in practice

  1. Every visible status color must map back to a real state field.
  2. Every number shown in a card must have a refresh or provenance path.
  3. Decorative panels are allowed, but they cannot outrank the primary action or the current risk signal.
  4. Zero after restart is not a bug if the source of truth is in-memory governor state. The UI should treat that zero as truth, not as loss.

Where to go next

On this page