# Add a Home Screen widget to your app

> Ask your Agents for a widget, add it to the Home Screen of a Preview device, and check it on your own iPhone.

Source: https://air.build/docs/build/add-a-widget-to-your-app/

A widget shows a piece of your app on the Home Screen, such as today's count or the next task, without opening the app. Your Agents add it to your app as an extension, a part of the app that iOS shows on its own. You try it on the Home Screen of a Preview device, then on your own iPhone.

This page is about a widget for the app you're building. For AirBuild's own widgets, see [Add AirBuild widgets to your Home Screen](https://air.build/docs/get-started/add-airbuild-widgets/).

## Ask for a widget

1. Open the project's chat.
2. Say what the widget should show, in which sizes (small, medium or large), and what tapping it should open.
3. Send it. The Agents add the widget and build the app again.

For example:

```text
Add a Home Screen widget that shows how many glasses of water I've had today. The small one shows the count, the medium one adds a bar for the day. Tapping it opens today's log.
```

A widget that shows what people saved in the app usually reads it through an App Group, which the Agents turn on for the app. See [Turn on iCloud, App Groups or another capability](https://air.build/docs/build/turn-on-an-app-capability/).

When the build is ready, the project's chat shows **New version ready** with **Open Preview**. See [Open the Preview when a new build is ready](https://air.build/docs/build/open-the-preview-when-a-build-is-ready/).

## See it in Preview

Preview has no widget button of its own. Its Home Screen is the device's own, and you add the widget the way you would on an iPhone.

1. Open Preview with the latest build. See [Run your app in Preview](https://air.build/docs/build/preview-your-app/#open-preview).
2. Tap **Home** to go to the Home Screen.
3. Touch and hold an empty part of the screen until the apps jiggle (on the Mac, click and hold). Start in the middle of the screen: a press that starts at the very top or bottom edge is taken as a swipe from the edge.
4. Tap **Edit**, then **Add Widget**.
5. Find your app in the list, swipe to the size you want, and tap **Add Widget**.
6. Tap **Done**.

Each size is its own widget, so add each size you asked for. Tap the widget to check what it opens.

To point at something on the widget, use **Screenshot** or **Draw** in Preview and send it to the Agents. See [Run your app in Preview](https://air.build/docs/build/preview-your-app/#use-the-device).

The Preview devices are shared by the Team, so the people in your Team see the widget you add.

## Check it on your iPhone

To see the widget on your own Home Screen with your own data, put the build on your iPhone, then add the widget as in steps 3 to 6 above:

- Install it from AirBuild. See [Install your app on your iPhone](https://air.build/docs/build/install-on-your-iphone/). Installing from AirBuild is in the TestFlight and direct-download builds of AirBuild, not the App Store build.
- Or get it through TestFlight. See [Share a beta with TestFlight](https://air.build/docs/app-store/test-with-testflight/).

## See what the widget declares

If the widget declares App Intents, for example for a button on it, the project's profile lists them. Open **Siri & Shortcuts** in the profile: they're under **Extension**, with the extension's bundle ID. See [Let people use your app from Siri and Shortcuts](https://air.build/docs/build/add-siri-and-shortcuts-to-your-app/).

## Questions

**My app isn't in the widget list in Preview.**

The device may still have an older build. Tap **Reinstall** (on iPhone, the app's icon, **Restart App**) to install the latest build, go **Home** and look again. If it's still missing, tell the Agents in the chat.

**The widget I added is gone.**

A Preview device that was shut down and started again is a fresh one, without the widgets added to it. Add the widget again.

**Is this the same as AirBuild's widgets?**

No. This page is about a widget in the app you're building. AirBuild's own widgets are in [Add AirBuild widgets to your Home Screen](https://air.build/docs/get-started/add-airbuild-widgets/).
