Menu
Docs

SwiftUI

Glimmer ships as a Swift package for iOS 17 and macOS 14 or later. It shares its colours, corners and fonts with the web kit, so the two stay in step.

1. Add the package

In Xcode, choose File → Add Package Dependencies and enter https://github.com/huntercash/glimmer-ui. Or in a package manifest:

Package.swift
dependencies: [
    .package(url: "https://github.com/huntercash/glimmer-ui", branch: "main"),
],
targets: [
    .target(name: "App", dependencies: [.product(name: "Glimmer", package: "glimmer-ui")]),
]
Pre-release: there is no tagged version yet, so the manifest tracks the main branch.

2. Apply the theme once

This sets the dark scheme, the page colours, the bundled font and the accent for every native control.

Swift
import Glimmer

ContentView()
    .glimmerTheme()

3. Use the pieces

Swift
VStack(spacing: 16) {
    SearchField(text: $query)
    Stat("Revenue", value: "$48,210", caption: "↑ 12% vs last month")
    Button("Save") {}.buttonStyle(.glimmer(.primary))
}
.padding()
.background(DotGrid())

Native controls stay native

Toggle, Slider, ProgressView, Gauge, Picker, sheets and popovers are the system's own. The theme tints them, so there is nothing extra to learn and they keep their accessibility behaviour.

Fonts and frost

Swift
Text("Night walk").font(.glimmer(.headline, weight: .semibold))
Text("2,418").font(.glimmerMono())

ContentView().glimmerFrost(2) // 1 clear ... 5 milky

Components with a SwiftUI equivalent

Each of these pages has a SwiftUI tab on its code boxes.