A shared SwiftUI design system for all SaneApps (SaneClip, SaneHosts, SaneBar, etc.).
- Glass morphism backgrounds with adaptive light/dark mode
- Consistent component library (sections, rows, toggles, badges)
- Semantic color and icon systems
- macOS 14+ optimized
- Swift 6 concurrency safe
Add SaneUI to your Swift Package dependencies:
dependencies: [
.package(path: "../SaneUI") // Local path
// or
.package(url: "https://github.com/sane-apps/SaneUI", from: "1.0.0")
]Then add it to your target:
.target(
name: "YourApp",
dependencies: ["SaneUI"]
)import SwiftUI
import SaneUI
struct SettingsView: View {
@State private var isEnabled = true
var body: some View {
ZStack {
SaneGradientBackground()
ScrollView {
VStack(spacing: 20) {
CompactSection("General", icon: SaneIcons.settings, iconColor: .gray) {
CompactToggle(
label: "Enable Feature",
icon: "star",
iconColor: .yellow,
isOn: $isEnabled
)
CompactDivider()
CompactRow("Version", icon: "info.circle", iconColor: .blue) {
Text("1.0")
.foregroundStyle(.secondary)
}
}
}
.padding(20)
}
}
}
}SaneGradientBackground- Glass morphism background with adaptive colorsVisualEffectBlur- macOS blur effect (NSVisualEffectView wrapper)GlassGroupBoxStyle- Glass morphism style for GroupBox
CompactSection- Grouped content with header, glass background, and shadowCompactRow- Standard row with icon, label, and trailing contentCompactToggle- Toggle switch row with icon and labelCompactDivider- Inset divider for separating rows
StatusBadge- Rounded capsule badge for status indicatorsColorDot- Small colored circle indicatorActionButton- Styled button with icon (primary, secondary, destructive)
SaneEmptyState- Empty view placeholder with icon, title, and actionSaneErrorState- Error state with message and retry actionLoadingOverlay- Semi-transparent loading indicator
// Semantic colors
SaneColors.accent // .teal
SaneColors.success // .green
SaneColors.danger // .red
SaneColors.warning // .orange
SaneColors.info // .blue
// Color extensions
Color.saneAccent
Color.saneSuccess
Color.saneDanger
Color.saneWarningUse SaneIcons for consistent SF Symbol usage:
Image(systemName: SaneIcons.add) // plus
Image(systemName: SaneIcons.remove) // trash
Image(systemName: SaneIcons.success) // checkmark.circle.fill
Image(systemName: SaneIcons.settings) // gear
// ... and many more| Property | Value |
|---|---|
| Corner radius | 10pt |
| Horizontal padding | 12pt |
| Vertical padding | 10pt |
| Section gap | 20pt |
| Major gap | 24pt |
- Background:
.hudWindowblur + teal gradient overlay - Card fill:
white.opacity(0.08) - Border:
white.opacity(0.12) - Shadow:
black.opacity(0.15), 8pt radius
- Background: Blue-gray gradient
- Card fill:
.white - Border:
teal.opacity(0.15) - Shadow:
teal.opacity(0.08), 6pt radius
- macOS 14.0+
- Swift 6.0+
- Xcode 16.0+
- SaneClip - Clipboard manager
- SaneHosts - Hosts file manager
- SaneBar - Menu bar manager
MIT License - See LICENSE file for details.