Apple Developer Documentation

Show relevant, glanceable content from your app as widgets in iOS and macOS, and as watch complications.

Overview

WidgetKit gives users ready access to content in your app by putting widgets on the iOS Home Screen and Today View, the macOS Notification Center, and by putting accessory widgets on the Lock Screen on iPhone and as complications in watchOS. Your widgets stay up to date so users always have the latest information at a glance. When they need more details, your widget takes them directly to the appropriate place in your app.

With different sizes (small, medium, large, extra large) and accessory styles (circular, rectangular, flat, and corner in watchOS), widgets can display a wide range of information. Users can personalize widgets to see details specific to their needs, and arrange their widgets in whatever way works best for them. When users stack widgets on the Home Screen and enable Smart Rotate, WidgetKit automatically rotates the most relevant widget to the top, making sure users see the most important details at exactly the right time.

Starting with iOS 16 and watchOS 9, WidgetKit allows you to create accessory widgets that appear as complications in watchOS and as widgets on the Lock Screen on iPhone. Accessory widgets are a great opportunity to bring your iOS app content to Apple Watch and your watchOS app content to iPhone.

To implement a widget, add a widget extension to your app. Configure the widget with a timeline provider, and use SwiftUI views to display the widget’s content. The timeline provider tells WidgetKit when to update your widget’s content.

Untitled

To make a widget user-configurable, add a custom SiriKit intent definition to your extension. In iOS, WidgetKit automatically provides a customization interface to let users personalize their widgets. Apple Watch doesn’t come with a dedicated user interface to configure widgets. To recommend preconfigured watch complications that use IntentConfiguration in the list of available complications, use IntentRecommendation. If you configure a accessory widget with StaticConfiguration, watchOS automatically includes the complication in the list.