Skip to content

Getting Started

ThemeKit is a brand-neutral SwiftUI design system. Every color, type style, spacing, radius, and shadow is a design token resolved at runtime from the active Theme. Inject a theme once and the whole UI re-skins — without touching component code.

See Installation for the SwiftPM details. In short:

.package(url: "https://github.com/isamercan/ThemeKit.git", from: "0.3.0"),

Call .themeKit() on your root view. This injects the active theme into the environment and repaints when it changes.

@main
struct MyApp: App {
init() { Theme.shared.applyPersistedConfig() } // restore last theme (optional)
var body: some Scene {
WindowGroup {
ContentView().themeKit() // inject + repaint on change
}
}
}

Read the theme from the environment and compose components. Spacing, color, radius and shadow all come from tokens — never hard-coded values.

struct ContentView: View {
@ThemeContext private var theme
var body: some View {
VStack(spacing: theme.spacing(.md)) {
Text("Welcome").textStyle(.headingBase)
PrimaryButton("Get started") { await signIn() }
}
.padding(theme.spacing(.base))
.background(theme.background(.bgElevatorPrimary))
.cornerRadius(.base)
.themeShadow(.elevated)
}
}
Theme.shared.loadTheme(named: "oceanTheme") // re-skins everything instantly