ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β βββ βββββββββββββ βββββββ βββββββββββββββββ βββ βββββββββββββββ β
β βββ ββββββββββββββββββββββ βββββββββββββββββ βββ ββββββββββββββββ β
β βββ ββ βββββββββ ββββββ ββββββββββ βββ βββββββ βββ βββ β
β ββββββββββββββββ ββββββ βββββββββ βββ βββββββ βββ βββ β
β ββββββββββββββββββββββββββββββββββββββ βββ βββ ββββββ βββ β
β ββββββββ ββββββββββ βββββββ ββββββββ βββ βββ ββββββ βββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β The Ultimate iOS Widget Development Framework β 50+ Templates Included! β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The most comprehensive iOS widget development kit with 50+ production-ready templates, Live Activities, Dynamic Island, Interactive Widgets, and StandBy mode support.
Features β’ Templates β’ Live Activities β’ Interactive β’ StandBy β’ Charts β’ Docs
| Feature | This Kit | Others |
|---|---|---|
| Widget Templates | 50+ | 5-10 |
| Live Activity Templates | 15 | 2-3 |
| Interactive Widgets | β | β |
| StandBy Mode | β | β |
| Dynamic Island | β | Partial |
| Lock Screen Widgets | 15 | 3-5 |
| SwiftUI Charts | β | β |
| Network Data Support | β | Basic |
| Timeline Management | Advanced | Basic |
| Deep Linking | β | β |
| Production Ready | β | β |
- Features
- Widget Templates (50+)
- Live Activities
- Interactive Widgets
- StandBy Mode
- Lock Screen Widgets
- Charts in Widgets
- Timeline Management
- Network Data Support
- Deep Linking
- Installation
- Quick Start
- Documentation
- π Home Screen Widgets β Small, Medium, Large, Extra Large
- π Lock Screen Widgets β Circular, Rectangular, Inline
- β‘ Live Activities β Real-time updates on lock screen
- ποΈ Dynamic Island β Compact and expanded views
- πΊ StandBy Mode β Full-screen widgets (iOS 17+)
- π±οΈ Interactive Widgets β Buttons, toggles, counters (iOS 17+)
- π SwiftUI Charts β Bar, line, pie, sparkline charts
- π Network Data β Fetch and cache remote data
- β±οΈ Smart Timeline β Battery-aware refresh strategies
- π Deep Linking β Open specific app content
- βοΈ Configuration β User-customizable widgets
- π¨ Theming β Custom colors and styles
| Template | Description | Size |
|---|---|---|
GradientCardWidget |
Beautiful gradient cards | S/M/L |
StatsWidget |
Statistics with progress bars | M/L |
CalendarWidget |
Upcoming events display | M/L |
WeatherWidget |
Weather conditions | S/M/L |
CountdownWidget |
Event countdown timer | S/M |
QuoteWidget |
Inspirational quotes | M/L |
MusicWidget |
Now playing info | M |
FitnessWidget |
Activity rings | S/M |
HabitTrackerWidget |
Habit tracking streaks | M/L |
FinanceWidget |
Account balances | M/L |
PhotoFrameWidget |
Photo display | S/M/L |
NotesWidget |
Quick notes preview | M/L |
BatteryWidget |
Device battery status | S/M |
ShortcutsWidget |
Quick action grid | M |
SocialStatsWidget |
Social media stats | M |
ClockWidget |
Analog/Digital clock | S/M |
TodoWidget |
Task list | M/L |
PodcastWidget |
Podcast player | M |
NewsWidget |
News headlines | M/L |
WaterTrackerWidget |
Water intake | S/M |
import SwiftUI
import WidgetKit
import iOSWidgetKit
struct MyWidgetView: View {
var entry: SimpleEntry
var body: some View {
WeatherWidget(
temperature: 72,
condition: .sunny,
location: "San Francisco",
high: 78,
low: 65
)
}
}| Template | Use Case |
|---|---|
DeliveryActivity |
Food/package delivery |
RideActivity |
Uber/Lyft style rides |
SportsScoreActivity |
Live sports scores |
TimerActivity |
Countdown timer |
WorkoutActivity |
Fitness tracking |
NowPlayingActivity |
Music player |
FlightActivity |
Flight tracking |
ParkingActivity |
Parking meter |
OrderActivity |
Order status |
MeetingActivity |
Calendar meetings |
import ActivityKit
import iOSWidgetKit
// Define your activity
let attributes = DeliveryAttributes(
orderNumber: "12345",
restaurantName: "Pizza Place"
)
let state = DeliveryAttributes.ContentState(
status: .onTheWay,
estimatedArrival: Date().addingTimeInterval(1800),
driverName: "John",
currentStep: 2
)
// Start the activity
let activity = try LiveActivityManager.shared.startActivity(
attributes: attributes,
contentState: state
)
// Update
await LiveActivityManager.shared.updateActivity(
activity,
with: DeliveryAttributes.ContentState(
status: .arriving,
estimatedArrival: Date().addingTimeInterval(300),
driverName: "John",
currentStep: 3
)
)
// End
await LiveActivityManager.shared.endActivity(activity)struct DeliveryActivityConfiguration: Widget {
var body: some WidgetConfiguration {
ActivityConfiguration(for: DeliveryAttributes.self) { context in
// Lock screen view
DeliveryActivityView(context: context)
} dynamicIsland: { context in
DynamicIsland {
// Expanded view
DynamicIslandExpandedRegion(.leading) {
Image(systemName: context.state.status.icon)
}
DynamicIslandExpandedRegion(.trailing) {
Text(context.state.estimatedArrival, style: .timer)
}
DynamicIslandExpandedRegion(.bottom) {
ProgressView(value: Double(context.state.currentStep), total: 4)
}
} compactLeading: {
Image(systemName: context.state.status.icon)
} compactTrailing: {
Text(context.state.estimatedArrival, style: .timer)
} minimal: {
Image(systemName: context.state.status.icon)
}
}
}
}iOS 17+ Only β Add buttons, toggles, and interactive elements.
InteractiveToggleWidgetβ Toggle switchesInteractiveCounterWidgetβ Increment/decrement countersInteractiveTaskListWidgetβ Task completion togglesInteractiveQuickActionsWidgetβ Action buttons gridInteractiveTimerWidgetβ Timer controlsInteractiveHabitWidgetβ Habit checkmarksInteractiveRatingWidgetβ Star ratingsInteractiveWaterWidgetβ Water intake buttons
import AppIntents
import iOSWidgetKit
// Interactive counter widget
struct MyInteractiveWidget: View {
let counterId = "daily_counter"
@AppStorage("counter_daily_counter", store: UserDefaults(suiteName: "group.widget"))
var count = 0
var body: some View {
InteractiveCounterWidget(
title: "Daily Count",
counterId: counterId,
currentValue: count,
accentColor: .blue
)
}
}
// Task list with toggles
struct TaskWidget: View {
var body: some View {
InteractiveTaskListWidget(
tasks: [
.init(id: "1", title: "Morning workout", isCompleted: true, priority: .high),
.init(id: "2", title: "Read 30 minutes", isCompleted: false, priority: .medium),
.init(id: "3", title: "Call mom", isCompleted: false, priority: .low)
],
listTitle: "Today's Tasks"
)
}
}iOS 17+ Only β Full-screen widgets for StandBy mode on iPhone.
| Template | Description |
|---|---|
StandByClockWidget |
Digital/Analog clocks |
StandByPhotoWidget |
Photo frames |
StandByWeatherWidget |
Weather display |
StandByCalendarWidget |
Calendar view |
StandByFitnessWidget |
Activity rings |
StandByMusicWidget |
Now playing |
StandByCountdownWidget |
Event countdown |
import iOSWidgetKit
struct MyStandByWidget: View {
var body: some View {
StandByClockWidget(
date: Date(),
style: .flipClock,
showDate: true,
accentColor: .white
)
}
}
// Apply StandBy optimizations
struct OptimizedWidget: View {
var body: some View {
VStack {
Text("Hello")
}
.standByOptimized(nightModeColor: .red)
}
}Circular Widgets:
CircularProgressWidgetβ Progress gaugeCircularIconWidgetβ Simple iconCircularRingWidgetβ Activity rings
Rectangular Widgets:
RectangularTextWidgetβ Multi-line textRectangularStatsWidgetβ StatisticsRectangularProgressWidgetβ Progress barRectangularCalendarWidgetβ EventsRectangularWeatherWidgetβ Weather
Inline Widgets:
InlineTextWidgetβ Text with iconInlineStatsWidgetβ Quick stats
Multi-Family Widgets:
LockScreenBatteryWidgetβ Battery (all sizes)LockScreenTimerWidgetβ Timer (all sizes)LockScreenFitnessWidgetβ Fitness (all sizes)LockScreenCountdownWidgetβ Countdown (all sizes)LockScreenQuickActionWidgetβ Actions (all sizes)
struct MyLockScreenWidget: Widget {
var body: some WidgetConfiguration {
StaticConfiguration(kind: "LockScreen", provider: Provider()) { entry in
// Automatically adapt to family
switch entry.family {
case .accessoryCircular:
CircularProgressWidget(
progress: 0.7,
icon: "star.fill",
accentColor: .blue
)
case .accessoryRectangular:
RectangularStatsWidget(
stats: [("Steps", "8,234"), ("Cal", "450"), ("Dist", "4.2mi")],
title: "Today"
)
case .accessoryInline:
InlineTextWidget(icon: "flame.fill", text: "450 calories burned")
default:
EmptyView()
}
}
.supportedFamilies([.accessoryCircular, .accessoryRectangular, .accessoryInline])
}
}SwiftUI Charts integration for beautiful data visualization.
| Chart | Description |
|---|---|
WidgetBarChart |
Vertical bar chart |
WidgetLineChart |
Line chart with area |
WidgetSparkline |
Minimal sparkline |
WidgetPieChart |
Pie/donut chart |
WidgetProgressRing |
Circular progress |
WidgetMultiLineChart |
Multiple series |
WidgetHorizontalBarChart |
Horizontal bars |
WidgetActivityChart |
GitHub-style activity |
WidgetStatsChart |
Stats with sparkline |
import iOSWidgetKit
import Charts
struct ChartWidget: View {
var body: some View {
VStack {
// Sparkline
WidgetSparkline(
values: [10, 25, 15, 30, 22, 35, 28],
color: .blue,
showGradient: true
)
.frame(height: 50)
// Stats with chart
WidgetStatsChart(
title: "Revenue",
value: "$12,450",
change: 12.5,
sparklineData: [100, 120, 110, 145, 160, 155, 180],
accentColor: .green
)
// Horizontal bar comparison
WidgetHorizontalBarChart(
data: [
.init(label: "Mon", value: 45),
.init(label: "Tue", value: 62),
.init(label: "Wed", value: 38)
],
accentColor: .purple
)
}
}
}Advanced timeline management for optimal battery and freshness.
- Smart Refresh Strategies β Time-based, battery-aware, content-aware
- Caching β Built-in cache layer
- Timeline Builder β Fluent API
- Metrics β Performance tracking
import iOSWidgetKit
// Use Timeline Builder
let timeline = TimelineBuilder<MyEntry>()
.addEntry(MyEntry(date: Date(), data: currentData))
.addEntry(MyEntry(date: Date().addingTimeInterval(3600), data: currentData))
.reloadAfter(1800) // 30 minutes
.build()
// Battery-aware refresh
let strategy = BatteryAwareRefreshStrategy(
normalInterval: 900, // 15 min normally
lowBatteryInterval: 3600, // 1 hour on low battery
lowBatteryThreshold: 0.2
)
// Use cache
TimelineCacheManager.shared.store(myData, forKey: "widget_data", expiration: 300)
if let cached: MyData = TimelineCacheManager.shared.retrieve(MyData.self, forKey: "widget_data") {
// Use cached data
}Fetch and display remote data in widgets.
import iOSWidgetKit
// Simple fetch
let data = try await NetworkDataProvider.shared.fetch(
WeatherResponse.self,
from: URL(string: "https://api.weather.com/data")!
)
// With caching
let provider = CachedNetworkProvider<WeatherResponse>(
cacheKey: "weather",
cacheDuration: 600
)
let weather = try await provider.fetch(from: url)
// Background refresh
BackgroundRefreshCoordinator.shared.scheduleBackgroundRefresh(
identifier: "weather_widget",
afterInterval: 1800
)Connect widget taps to specific app content.
import iOSWidgetKit
// Build deep link URL
let url = WidgetDeepLinkManager.shared.buildContentURL(
contentType: "task",
contentId: "123",
parameters: ["source": "widget"]
)
// In widget view
Link(destination: url!) {
TaskRow(task: task)
}
// Handle in app
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.onWidgetURL { url in
let params = WidgetDeepLinkManager.shared.parseParameters(from: url)
// Navigate to content
}
}
}
}dependencies: [
.package(url: "https://github.com/muhittincamdali/iOS-Widget-Development-Kit.git", from: "2.0.0")
]pod 'WidgetDevelopmentKit', '~> 2.0'File β New β Target β Widget Extension
import WidgetKit
import SwiftUI
import iOSWidgetKitstruct MyWidget: Widget {
let kind: String = "MyWidget"
var body: some WidgetConfiguration {
StaticConfiguration(kind: kind, provider: MyProvider()) { entry in
WeatherWidget(
temperature: entry.temperature,
condition: entry.condition,
location: entry.location,
high: entry.high,
low: entry.low
)
}
.configurationDisplayName("Weather")
.description("Shows current weather.")
.supportedFamilies([.systemSmall, .systemMedium])
}
}iOS-Widget-Development-Kit/
βββ Sources/
β βββ Templates/ # 20+ Home Screen widget templates
β βββ LiveActivities/ # 10+ Live Activity templates
β βββ Interactive/ # iOS 17 interactive widgets
β βββ StandBy/ # StandBy mode widgets
β βββ LockScreen/ # 15 Lock Screen widgets
β βββ Charts/ # SwiftUI Charts for widgets
β βββ Core/ # Timeline management
β βββ Network/ # Network data support
β βββ Configuration/ # Deep linking & config
βββ Examples/ # Sample implementations
βββ Tests/ # Comprehensive tests
βββ Documentation/ # Guides & tutorials
| Requirement | Minimum |
|---|---|
| iOS | 16.0+ |
| Xcode | 15.0+ |
| Swift | 5.9+ |
Feature Requirements:
| Feature | iOS Version |
|---|---|
| Home Screen Widgets | 14.0+ |
| Lock Screen Widgets | 16.0+ |
| Live Activities | 16.1+ |
| Dynamic Island | 16.1+ |
| Interactive Widgets | 17.0+ |
| StandBy Mode | 17.0+ |
| Guide | Description |
|---|---|
| Widget Design Guide | Design best practices |
| Timeline Management | Refresh strategies |
| Live Activities Guide | Dynamic Island setup |
| Interactive Widgets | iOS 17 interactions |
| StandBy Mode | Full-screen widgets |
| Network Data | Remote data fetching |
| Best Practices | Performance tips |
Contributions welcome! See CONTRIBUTING.md.
git checkout -b feature/amazing-widget
git commit -m "feat(widgets): add amazing widget template"
git push origin feature/amazing-widgetMIT License β see LICENSE for details.