A comprehensive Swift UI Component Library designed for iOS 17+, iPadOS, macOS 14+, and visionOS. Features modern liquid glass morphism effects, adaptive layouts, and production-ready components.
- πͺ Glass Effects - iOS 26+ liquid glass morphism with adjustable intensity
- ποΈ Adaptive Components - Responsive design for iPhone, iPad, Mac, and Vision Pro
- π¨ Design System - Consistent theming with color, spacing, and typography tokens
- β‘ Haptic Feedback - Native haptic feedback on iOS
- βΏ Accessibility - Full VoiceOver, Dynamic Type, and reduced motion support
- π¬ Animations - Rich animation presets and micro-interactions
- π Documentation - Complete DocC documentation
GlassButton- Liquid glass effect button with haptic feedbackGlassIconButton- Circular icon-only buttonGlassPillButton- Capsule-shaped button for tags/filters
GlassTextField- Single-line text inputGlassTextEditor- Multi-line text editorGlassSearchField- Animated search inputGlassSlider/GlassRangeSlider- Custom slidersGlassToggle/GlassCheckbox/GlassRadioButton- Selection controlsGlassDatePicker/GlassTimePicker- Date/time selection
GlassCard- Glass-styled containerGlassChip/GlassStatusChip- Tags and status indicatorsGlassAvatar/GlassAvatarGroup- User avatars with statusGlassEmptyState- Empty state placeholdersGlassBadge- Notification badges
GlassSidebar- Collapsible sidebar navigationGlassTabBar- Custom tab barGlassSegmentedControl- Segmented controlAdaptiveHeader- Responsive navigation header
GlassModal- Centered modal with backdrop blurGlassAlert- Alert dialogGlassActionSheet- Bottom action sheetGlassPopover- Floating popover with arrowGlassTooltip- Simple tooltipsGlassContextMenu- Context menu
GlassToast- Toast notificationsGlassLoadingIndicator- Loading spinnerGlassProgressBar- Progress indicatorSuccessCheckmark- Animated success indicator
AdaptiveStack- Responsive H/V stackFlexibleGrid- Auto-adjusting gridResponsiveContainer- Max-width containerDesktopLayout- Sidebar + content + inspectorFloatingPanel- Draggable floating panelMasonryLayout- Pinterest-style layout
SwipeGallery- Swipeable galleryImageGallery- Full-featured image gallery with zoomCarousel- 3D carousel with perspective
Add to your Package.swift:
dependencies: [
.package(url: "https://github.com/ownerCTI/ComponentLibrary_Web_Swift.git", from: "1.0.0")
]Or in Xcode: File β Add Package Dependencies β Enter repository URL
import SwiftUI
import ComponentLibrary
struct ContentView: View {
@State private var searchText = ""
@State private var sliderValue = 0.5
var body: some View {
ZStack {
// Background gradient
LinearGradient(
colors: [.indigo, .purple],
startPoint: .topLeading,
endPoint: .bottomTrailing
)
.ignoresSafeArea()
VStack(spacing: 20) {
GlassSearchField(text: $searchText)
GlassButton("Get Started", icon: "arrow.right", style: .primary) {
// Action
}
GlassSlider(value: $sliderValue, showValue: true)
GlassCard {
Text("Glass Card Content")
.foregroundColor(.white)
}
}
.padding()
}
}
}ContentView()
.componentTheme(DarkTheme()) // or LightTheme(), DefaultTheme()let brandTheme = CustomThemeBuilder()
.primaryColor(Color(hex: "FF6B6B"))
.secondaryColor(Color(hex: "4ECDC4"))
.accentColor(Color(hex: "FFE66D"))
.glassTint(Color(hex: "FF6B6B"))
.cornerRadius(small: 8, medium: 16, large: 24)
.build()
ContentView()
.componentTheme(brandTheme)// Colors
ColorTokens.accentPrimary
ColorTokens.success
ColorTokens.glassBackground
// Spacing (4pt grid)
SpacingTokens.sm // 12pt
SpacingTokens.md // 16pt
SpacingTokens.lg // 24pt
// Typography
TypographyTokens.headline
TypographyTokens.body
// Radius
RadiusTokens.lg // 12pt
RadiusTokens.xl // 16ptAll components include:
- VoiceOver labels and hints
- Dynamic Type support
- Reduced motion support
- High contrast mode
- Minimum 44x44pt touch targets
// Accessibility modifiers
myView.accessible(label: "Submit button", hint: "Double tap to submit form")
myView.minimumTouchTarget()
myView.accessibleAnimation(.spring())// Animation presets
AnimationPresets.snappy
AnimationPresets.bouncy
AnimationPresets.gentle
// Transitions
TransitionPresets.modal
TransitionPresets.toast
TransitionPresets.slideUp
// Effects
myView.shimmer()
myView.pulse()
myView.rippleEffect()
myView.staggeredAnimation(index: 0)- iOS 17.0+ / macOS 14.0+ / visionOS 1.0+
- Xcode 15.0+
- Swift 5.9+
swift testMIT License - see LICENSE file for details.
Contributions are welcome! Please read our contributing guidelines before submitting PRs.
Made with β€οΈ for the Swift community
