SweetUI

Search items

Jump to an item

Themes

One modifier, every screen

RegistryTheme: optional accent, label color, surface, hairline border, positive/negative, disabled opacity, metrics. Apply once via .registryTheme(_:) at root; items read tokens from the environment, controls follow tint.

Presets

Starting points, each a plain static let to copy/edit. Cards: first screen of the preview wall ( preview block, 33 cards), iPhone 17.

System, light
System
Inherits the app tint. The default.
ContentView()
    .registryTheme(.system)
Graphite, light
Graphite
Ink on paper: primary accent, background label.
ContentView()
    .registryTheme(.graphite)
Indigo, light
Indigo
The Showcase's own accent.
ContentView()
    .registryTheme(.indigo)
Rose, light
Rose
Warm and friendly.
ContentView()
    .registryTheme(.rose)
Emerald, light
Emerald
Growth and confirmation.
ContentView()
    .registryTheme(.emerald)
Amber, light
Amber
A light accent that proves the on-accent token.
ContentView()
    .registryTheme(.amber)
Mango, light
Mango
MangoByte's sample design system: strokeless, generous, one warm accent.
ContentView()
    .registryTheme(.mango)

MANGO, a design system built on the registry

A worked brand example, a template to build your own.

MANGO: rounded type via .fontDesign(.rounded), strokeless surfaces (zero border opacity, depth from surface step), one accent, two owned/edited items, critically-damped button press, tabular metric-card digits, preset .mango. Code opens it in Create as a template.

ContentView()
    .registryTheme(.mango)
    .fontDesign(.rounded)
sweetui preset apply a74hGF01CVunaG0vzZJG --destination Sources/YourFeature/Components

Open MANGO in Create · docs/mango.md

MANGO demo, Showcase, light

Tune it live

The Showcase's tuning panel is the theme creator, beside the catalog.

Every token: a slider or swatch beside live preview: accent, label color, surface/border opacity, border widths, 3 radii, 4 spacings, disabled opacity. Appearance, text size, RTL check result. Copy Swift puts the exact initializer on pasteboard; Copy Code puts the preset code instead:

let theme = RegistryTheme(
    accent: .primary,
    onAccent: Color(uiColor: .systemBackground),
    surface: .primary.opacity(0.050),
    border: .primary.opacity(0.100),
    disabledOpacity: 0.500,
    metrics: RegistryMetrics(
        compactSpacing: 8,
        standardSpacing: 16,
        sectionSpacing: 24,
        controlHorizontalPadding: 12,
        borderWidth: 1,
        emphasizedBorderWidth: 2,
        compactRadius: 6,
        controlRadius: 10,
        cardRadius: 18
    )
)

// Apply once at the root of your scene; every registry item below inherits it.
ContentView()
    .registryTheme(theme)

Open Examples/Showcase/SweetUIShowcase.xcworkspace, run Showcase, tap Tune above the tab bar. Panel: inspector on iPad, sheet on iPhone (catalog interactive beneath). Demos update live. Copy Code puts a preset code on pasteboard; Create page and sweetui preset read it. Captures: preview wall's first screen ( preview block, 33 cards), iPhone 17.

Every token

TokenDefaultRead by
accentnil (app tint)tinted items, via subtree tint
onAccent.whitebutton, auth-form
surface.primary.opacity(0.055)card, input, badge, select, textarea, avatar, alert, empty, blocks
border.primary.opacity(0.08)card, input, badge, separator, select, textarea, checkbox, accordion
positive.greenbadge, progress, transaction-row, alert
negative.redbadge, button, input, textarea, transaction-row, alert, auth-form
disabledOpacity0.5button, checkbox, input, select, textarea
metrics.compactSpacing8badge, label, rows
metrics.standardSpacing16card, metric-card, blocks
metrics.sectionSpacing24blocks
metrics.controlHorizontalPadding12input, select
metrics.borderWidth / emphasizedBorderWidth1 / 2inputs at rest, focused, or invalid
metrics.compactRadius / controlRadius / cardRadius6 / 8 / 16badge/checkbox, controls/alerts, cards
fontDesignnil (system)every text, via registryTheme's .fontDesign when set
surfaceStep0.02elevation ladder, registrySurface(level:), RegistrySurfaceLevel
chartPalette.accentchart, via chartForegroundStyleScale
backgroundnil (system background)scene root, when set
foregroundnil (system label)scene root; secondary hierarchy derives from it
secondaryForegroundnil (system secondary label)scene root, paired with foreground when set