sindresorhus/Defaults
💾 Swifty and modern UserDefaults observed · 2026-08-28
Health v2 · maintenance only
87/100
- Activity 89
- Release rhythm 78
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 41
- age_days: 3066
- days_rel: 71
- days_push: 71
- n_releases_24m: 10
Adoption not part of the score
2494 stars · 164 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A Swift library providing a strongly-typed, modern facade over UserDefaults for persistent key-value storage in Apple platform apps. It supports Codable values, SwiftUI property wrappers, change observation, and iCloud synchronization.
Use cases
- store app settings persistently across launches
- replace @AppStorage with strongly-typed defaults
- observe changes to user preference values
- store Codable types in UserDefaults
- sync app preferences across devices via iCloud
- use UserDefaults outside of SwiftUI
When to choose
- you're building a macOS, iOS, tvOS, watchOS, or visionOS app in Swift
- you want type-safe, centralized defaults with default values defined in one place
- you need SwiftUI bindings plus observation outside SwiftUI
- you want to store Codable or custom types in user defaults
When to avoid
- you need a database or large structured storage rather than key-value preferences
- you target platforms outside Apple's ecosystem
- you're not using Swift or Swift Package Manager
- you need cross-platform persistence like shared preferences on Android
Facets
library · maturity stable
state-management serialization developer-tools mobile-development desktop-applications developer-tools cross-platform userdefaults swift-package-manager swiftui key-value-storage codable icloud-sync apple-platforms macos ios swift
1 source
- readme: https://github.com/sindresorhus/Defaults · fetched 2026-08-28 · 4d9e9ad72f2e
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| sindresorhus/Defaults | main | 87 |
For agents
markdown · JSON · MCP: product_card(name="sindresorhus/Defaults")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem