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.
1. Add the package
Section titled “1. Add the package”See Installation for the SwiftPM details. In short:
.package(url: "https://github.com/isamercan/ThemeKit.git", from: "0.3.0"),2. Inject the theme at the root
Section titled “2. Inject the theme at the root”Call .themeKit() on your root view. This injects the active theme into the
environment and repaints when it changes.
@mainstruct MyApp: App { init() { Theme.shared.applyPersistedConfig() } // restore last theme (optional) var body: some Scene { WindowGroup { ContentView().themeKit() // inject + repaint on change } }}3. Build with token-bound views
Section titled “3. Build with token-bound views”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) }}4. Switch themes at runtime
Section titled “4. Switch themes at runtime”Theme.shared.loadTheme(named: "oceanTheme") // re-skins everything instantlyNext steps
Section titled “Next steps”- Theming — built-in presets and generating a theme from one accent color
- Form Validation — the validation layer
- Accessibility — Dynamic Type, VoiceOver, Reduce Motion
- Component Gallery — browse all components
- DocC API Reference — full symbol-level docs