widgetkit

Implement and review WidgetKit widgets, controls, and timeline providers for iOS.

70|4|Updated Jul 22, 2025
One-click install
npx skills add https://github.com/AlexW00/Zettel --skill widgetkit-alexw00
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: widgetkit
Source: https://github.com/AlexW00/Zettel/tree/main/.agents/skills/widgetkit
Command: npx skills add https://github.com/AlexW00/Zettel --skill widgetkit-alexw00

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building iOS widgets involves many subtle rules around timeline providers, refresh budgets, push reloads, deep links, and rendering modes, and mistakes lead to stale widgets, rejected configurations, or broken Control Center controls. This Skill provides structured guidance and review checklists for implementing and auditing WidgetKit code correctly. ## Core Features & Use Cases - Widget Implementation Guidance: Covers Widget protocol, WidgetBundle, StaticConfiguration, AppIntentConfiguration, TimelineProvider, and AppIntentTimelineProvider with Swift code examples. - Modern Surface Support: Documents interactive widgets, Control Center controls, Lock Screen accessory widgets, StandBy, CarPlay, Liquid Glass rendering, and iOS 26 push reload handlers. - Review Checklist & Common Mistakes: Provides a checklist for auditing widget code covering App Groups, refresh budgets, placeholder behavior, push handler registration, and Smart Stack relevance. - Use Case: When adding a configurable Home Screen widget with a Control Center toggle to an iOS app, use this Skill to scaffold the widget extension, wire AppIntentTimelineProvider, register push handlers, and verify the implementation against the review checklist. ## Quick Start Use the widgetkit skill to review my widget extension code and check it against the WidgetKit review checklist.

Frequently Asked Questions about widgetkit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a configurable widget in SwiftUI with WidgetKit?▼

Use AppIntentConfiguration paired with an AppIntentTimelineProvider, which receives the user's configuration intent in its snapshot and timeline methods. Define a WidgetConfigurationIntent type available to the widget extension, then register the widget in a WidgetBundle annotated with @main.

What is the difference between TimelineProvider and AppIntentTimelineProvider?▼

TimelineProvider is for static, non-configurable widgets and uses completion handlers, while AppIntentTimelineProvider is for configurable widgets and uses async/await with the user's intent configuration. Prefer AppIntentTimelineProvider over the older SiriKit-based IntentTimelineProvider for new widgets.

How do WidgetKit push notifications update a widget?▼

Add the Push Notifications capability to the widget extension, implement a WidgetPushHandler, and register it with .pushHandler(...) on the widget configuration. Send APNs pushes with apns-push-type: widgets and a content-changed payload; the push triggers a timeline reload rather than delivering state.

Why is my widget not sharing data with the main app?▼

The widget extension runs in a separate process, so you must enable App Groups on both targets and share data via UserDefaults(suiteName:) or the shared group container. After writing data, call WidgetCenter.shared.reloadTimelines(ofKind:) to refresh the widget.

Can small widgets have multiple tap targets with Link?▼

Yes, Link can be used in .systemSmall, .accessoryRectangular, and larger system widgets, combined with one widgetURL(_:) as the general fallback. Never attach multiple widgetURL modifiers in the same view hierarchy, as behavior is undefined.

When should widget code hand off to ActivityKit or App Intents skills?▼

WidgetKit owns widget registration, controls, and surfaces, while Live Activity lifecycle, APNs content-state, and Dynamic Island depth belong to ActivityKit, and intent modeling, entities, Siri, and Shortcuts belong to App Intents. Keep only the integration points, such as ActivityConfiguration registration, in WidgetKit code.