Await Widget Developer Docs
Await widgets are small iOS widget experiences written in TSX with a SwiftUI-style component DSL. They run in the Await host, not in a browser, so code uses components from await, global Await bridge APIs, and TypeScript declarations from @await-widget/runtime.
This documentation is AI-first: it is meant to be read by coding agents as well as by people. If you are using AI to create or modify a widget, tell the AI to read this directory before writing code.
Ask An AI To Use These Docs
Use this prompt when starting a widget task:
text
Read skills/await-widget/SKILL.md and skills/docs/README.md first.
Then read the guide or reference pages relevant to my request.
Use only APIs declared in @await-widget/runtime or documented under skills/docs/reference.
Do not use HTML tags, CSS, React hooks, React state, fetch, or browser APIs.Reading Paths
For AI-assisted non-coders:
- Read Create A Widget.
- Read Panels if you want editable settings.
- Read Bridge APIs if the widget needs data from store, network, files, weather, calendar, reminders, health, media, audio, or location.
- Use the Prompt Cookbook.
For TypeScript developers:
- Read Runtime Model.
- Read Timeline and Intents.
- Use the generated reference pages under Reference.
- Check
library/gallery/*/index.tsxfor complete examples.
Core Rules
- Import components only from
await. - Register widgets with
Await.define({...}). - Native HTML elements are invalid. Do not write
<div>,<span>, or browser DOM code. - Use props and modifiers for layout and styling. Do not use CSS or
styleobjects. - Use
AwaitNetwork.request(...)instead offetch. - Treat
runtime/types/*.d.tsas the source of truth. - Keep widget view trees and timelines small unless the visible result needs more complexity.
Guides
Reference
Examples
Use library/gallery/*/index.tsx as larger examples. Useful starting points:
library/gallery/Panels/index.tsxfor panels, timeline, store, and intents.library/gallery/Weather/index.tsxfor weather data.library/gallery/Calendar/index.tsxfor calendar data.library/gallery/Reminder/index.tsxfor reminders.library/gallery/Music/index.tsxfor media data.library/gallery/Location/index.tsxfor location data.