Foundations/Icons
Icon System
SwiftDS uses SF Symbols, Apple's comprehensive icon library with over 5,000 symbols that automatically adapt to weight, size, and color.
Icon Sizes
★
small
Inline icons, badges
16pt
★
medium
Default icon size
20pt
★
large
Navigation, headers
24pt
★
xl
Feature icons
32pt
Usage
Example
import SwiftUI
// Basic icon
Image(systemName: "heart.fill")
.foregroundColor(.dsPrimary)
// Icon with size
Image(systemName: "star.fill")
.font(.system(size: 20))
.foregroundColor(.dsAccent)
// Icon in button
Button {
// action
} label: {
Label("Save", systemImage: "checkmark.circle.fill")
}
.buttonStyle(.primary)SF Symbols
SF Symbols provides a consistent icon language across Apple platforms with:
- •Automatic alignment: Icons align with text baselines
- •Variable color: Multi-color rendering support
- •Weight matching: Icons match text weight automatically
- •Accessibility: VoiceOver support built-in
Best Practices
- •Use filled variants for selected/active states
- •Prefer semantic colors (success, warning, error) for status icons
- •Keep icon sizes consistent within the same context
- •Provide accessibility labels for icon-only buttons