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:
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.
import Glimmer
ContentView()
.glimmerTheme()3. Use the pieces
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
Text("Night walk").font(.glimmer(.headline, weight: .semibold))
Text("2,418").font(.glimmerMono())
ContentView().glimmerFrost(2) // 1 clear ... 5 milkyComponents with a SwiftUI equivalent
Each of these pages has a SwiftUI tab on its code boxes.
GlassFrostDot gridStreaksFlareMetaButtonText inputTextareaSelectToggleRangeSearchCardBadgeStatusAvatarStatAccordionChat bubbleDividerAlertTooltipProgressRadial progressSpinnerOrbSkeletonCharts overviewLine chartArea chartBar chartScatter plotHistogramHeatmapPie and donutRadar chartCandlestick chartOHLC chartRSIMACDChord diagramTabsMenuDockModalDrawerPopover