Apple Widgets are a powerful way to add custom functionality to your app. They are small, interactive widgets that can be added to the home screen of your device.

Prerequisites

Useful commands

To create an iOS widget, run the following command in your project:

npx create-target

Add the following script to your package.json file, and then run the command to generate the widget code and ensure the preview works correctly:

"scripts": {
  "prewidget": "npx expo prebuild --template node_modules/@bacons/apple-targets/prebuild-blank.tgz --clean",
}
🏆 Challenge: Add an iOS Widget to Your App

Create an iOS widget and share it on the Discord or tag me on X or Bluesky.

Resources

Is this lesson useful?