All open-source packages
UISwift

SwiftUI-Components

Ready-made SwiftUI views for iOS 17 and macOS 14, with form validation and accessible gestures

32StarsLatest Release: v2.1.0Updated: October 15, 2026
Platforms:iOS 17macOS 14

License: MIT

A dependency-free Swift package of SwiftUI views: buttons, cards, charts, form inputs with validation, gestures, lists, overlays, loaders and toasts. Each component is a plain View configured through its initializer, so you can use one or two without adopting a theme system. The logic behind them, such as card-number checks, validators, JSON form schemas and swipe and shape recognition, is covered by Swift Testing suites that run on macOS and an iPhone simulator.

Features

  • 223 views, 12 view modifiers and 5 gesture modifiers in 14 categories, counted from the sources
  • Composable validators, errors that appear after the first edit, debounced server checks and multi-step forms
  • Forms rendered from JSON; schema patterns run with a 20 ms limit per match and a 100 ms budget per check
  • Swipes, edge swipes, swipe sequences, pinch-rotate-drag and shape drawing, each with an accessibility action
  • One code base for iOS and macOS: almost all UIKit-only details map to AppKit or to no-ops in one platform file
  • Swift 6 language mode, no dependencies, and README samples compiled by the example app and the test target
  • WCAG 2 contrast ratio and level for SwiftUI colors with ColorContrast

Quickstart

swift
1import SwiftUI
2import SwiftUIComponents
3 
4struct ContentView: View {
5 @State private var rating = 3.0
6 
7 var body: some View {
8 VStack(spacing: 20) {
9 Text("Rate this app")
10 .font(.headline)
11 RatingInput(rating: $rating)
12 PrimaryButton("Send rating") {
13 print("Rating: \(rating)")
14 }
15 }
16 .padding()
17 }
18}

Installation

Xcode (File › Add Package Dependencies…)

text
1https://github.com/muhittincamdali/SwiftUI-Components.git

Swift Package Manager

swift
1dependencies: [
2 .package(url: "https://github.com/muhittincamdali/SwiftUI-Components.git", from: "2.1.0")
3],
4targets: [
5 .target(name: "YourApp", dependencies: [
6 .product(name: "SwiftUIComponents", package: "SwiftUI-Components")
7 ])
8]

Screenshots

Button gallery, light mode
Button gallery, dark mode
Card gallery, light mode
Chart gallery, light mode
Indicator gallery, light mode
Validated sign-up form in the example app
Contact form rendered from JSON in the example app
Swipe, pinch-rotate-drag and shape drawing in the example app

Timeline

  1. Repository opened; v1.0.0 tagged on the first commit (14 source files, iOS 16 and macOS 13)

  2. Package slimmed down: the components were removed and replaced with placeholder code (c7b3799)

  3. Rebuilt as 2.0.0: components restored for iOS 17 and macOS 14 in the Swift 6 language mode, with tests, CI and DocC (PR #3)

  4. 2.1.0: validation, JSON forms, gestures and a contrast checker, rewritten from SwiftUI-Forms-Kit, SwiftUI-Gesture-Library and iOSUIComponents, which were archived (PR #6)

Links

Merged Repositories

Related Article

Read the article