/themekit:themekitfrom themekit
Writes SwiftUI UI with the ThemeKit design system: tokenized components (Badge, Card, TextInput, Select, Carousel), runtime theming, theme presets, and chainable modifiers.
Ships in themekit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A token-driven, brand-neutral SwiftUI component library. Every color,
radius, spacing, type style and shadow is a design token resolved at runtime
from the active Theme. Write UI with its components + modifiers; the theme
re-skins everything.
For the full component list + each one's init params + modifiers, read
references/components.md. For the theme-preset
catalog, read references/themes.md.
.foregroundStyle(.blue), no Color(hex:) in
app code. Pull from the theme: theme.text(.textPrimary),
theme.background(.bgWhite), or a SemanticColor (SemanticColor.primary.base).@Environment(\.theme) private var theme.
It defaults to Theme.shared..environment(Theme.shared).init; variants, sizes, flags, colors and
callbacks are modifiers — e.g. Badge("New").badgeStyle(.info).badgeShape(.rounded)..controlSize(.small) (not a size: arg).
Disabled state is native: .disabled(_:) (not an isEnabled: arg).import ThemeKit
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
ContentView().environment(Theme.shared) // inject the theme once
}
}
}
struct ContentView: View {
@Environment(\.theme) private var theme
var body: some View {
VStack(spacing: Theme.SpacingKey.md.value) {
Text("Hello").foregroundStyle(theme.text(.textPrimary))
PrimaryButton("Continue") { /* … */ }.fullWidth()
}
.padding(Theme.SpacingKey.lg.value)
.background(theme.background(.bgWhite))
}
}
theme.text(.textPrimary | .textSecondary | .textTertiary | .textDisabled | .textHero)theme.background(.bgWhite | .bgElevatorPrimary | .bgSecondary | .bgHero | …) — default component surface is .bgWhite (base-100)theme.border(.borderPrimary | .borderHero | …)theme.foreground(.fgHero | .fgSecondary | …)theme.custom.color(.fareBadge) — names ThemeKit has no key
for, under the reserved custom. namespace. Register app-owned ones once with
Theme.shared.registerCustomTokens(_:) (survives theme changes; darkColors for
dark), or declare theme-owned ones as "custom.<name>" in a theme JSON /
--custom-color-* in CSS. Always ?? a built-in token as the fallback..buttonChromeStyle(_:), .badgeChromeStyle(_:),
.countBadgeStyle(_:), .iconTileStyle(_:), .priceTagStyle(_:),
.radioButtonChromeStyle(_:), .skeletonStyle(_:), .dividerStyle(_:),
.calloutChromeStyle(_:), .inlineTextStyle(_:), .chipStyle(_:). Set once at the
root; it reaches the copies ThemeKit composes too. Resolve colours inside the style
from @Environment(\.theme). No style set = the built-in look, unchanged (ADR-0009).SemanticColor): .primary .secondary .accent .neutral .info .success .warning .error + hues. Each gives .solid .soft .accent .border
variants and a 50..900 ladder (.base .hover .active .strong .bg …). Use with
FillVariant (.solid .soft .outline .ghost) on the configurable components.Theme.RadiusRole.box.value (cards/modals), .field.value (buttons/inputs),
.selector.value (checkboxes/badges). Size ramp also exists:
Theme.RadiusKey.sm.value etc.Theme.SpacingKey.xs|sm|md|base|lg|xl.value.textStyle(.headingSm | .bodyBase400 | .labelMd600 | …) (a view modifier).Browse references/components.md for all of them.
The configurable ones take a SemanticColor + FillVariant, so brand/accent
recolor for free:
Badge("Sale").badgeStyle(.error).variant(.solid)
Chip("Pool", isSelected: $on).icon("drop.fill")
ThemeButton("Save") { save() }.color(.accent).variant(.solid)
TextInput("Email", text: $email).icon(leading: "envelope")
.a11yID("login.email")
Select("Country", options: countries, selection: $country) { $0.name }
Checkbox("I agree", isChecked: $agree).controlSize(.small)
Card(title: "Booking") { /* content */ }
Rating(value: 4.5).allowHalf().onRate { rating = $0 }
ProgressBar(value: 0.6).showsPercentage().gradient()
// Recolor the whole app from one accent (generates the full palette on-device):
Theme.shared.applyGenerated(primaryHex: "7C3AED")
// Or a full config (accent + base surface + secondary/accent brand colors):
Theme.shared.apply(ThemeConfig(primaryHex: "ff79c6", baseHex: "282a36",
secondaryHex: "bd93f9", accentHex: "ffb86c", dark: true))
// Inject a theme into ONE subtree only:
let ocean = Theme(); ocean.applyGenerated(primaryHex: "0fb4ab")
BookingCard().theme(ocean)
ThemeKit bundles 33 theme presets (inspired by daisyUI). Apply one, or drop the ThemePicker
grid into a screen:
ThemePreset.named("dracula")?.apply() // recolor Theme.shared live
@State private var active: String? = "cupcake"
ThemePicker(selection: $active) // tappable grid of all 33 themes
Themed form
@Environment(\.theme) private var theme
Card(title: "Sign up") {
VStack(spacing: Theme.SpacingKey.md.value) {
TextInput("Email", text: $email).icon(leading: "envelope").a11yID("email")
TextInput("Password", text: $pw, isSecure: true).a11yID("pw")
Checkbox("Accept terms", isChecked: $terms)
PrimaryButton("Create account") { submit() }.fullWidth().disabled(!terms)
}
}
Theme switcher screen — see ThemePicker + the theme-presets section above.
.foregroundStyle(.blue) / Color(hex:) in app UI → ✅ a theme token.Badge("x", size: .small) → ✅ Badge("x").size(.small) (size/variant/style
are modifiers now — check references/components.md for each component's set).SomeControl(isEnabled: false) → ✅ SomeControl().disabled(true).cornerRadius: 12 → ✅ Theme.RadiusRole.box.value.custom. namespace (registerCustomTokens(_:) / theme.custom).theme.custom.color("custom.fare-badge") → ✅ the bare name; the lookup adds
the prefix (theme.custom.color(.fareBadge))..badgeChromeStyle(_:), …).What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
swiftui, design-system, design-tokens, theming, ui-components
npx claudepluginhub isamercan/themekit --plugin themekitOther plugins' skills for the same job