Screen.Recording.2026-08-06.at.3.52.45.PM.mp4
Active development — APIs and architecture are changing. Follow @dev_atrii on X for updates.
WARP (Widget Abstraction, Rendering Pipeline) is a unified API for creating home-screen widgets in Kotlin Multiplatform.
Write widget UI once in Kotlin → render on Android (Jetpack Glance) and iOS (WidgetKit + SwiftUI).
Compose-like Kotlin UI → WarpNode tree → JSON → platform renderer
↑
shared state & click handlers
Describe widget UI in commonMain with composable primitives — same counter on Android Glance and iOS WidgetKit:
@Composable
fun CounterWidgetUi(state: CounterState) {
WarpColumn(
modifier = WarpModifier().padding(WarpPadding(16, 16, 16, 16)),
) {
WarpText("Counter")
WarpRow {
WarpButton(text = "-", onClick = CounterActions.Decrement.asClickAction())
WarpText(state.count.toString())
WarpButton(text = "+", onClick = CounterActions.Increment.asClickAction())
}
}
}
// Compose state → tree → platform render
val node = composeWarp(CounterState(count = count), CounterWidgetUi)
WarpRender(node, counterWidgetClickHandlers(dataStore, widgetUpdater)) // Android Glance
// iOS: renderCounterWidget() → WidgetKit (.systemSmall)See example/counter/CounterWidget.kt for the full demo.
| Module | Role |
|---|---|
| warp-runtime | Author widget UI (WarpColumn, WarpText, WarpButton), compose to tree/JSON, click wire format |
| warp-ui | Platform renderers — Glance (Android), iOS via spm4Kmp |
| warp-widget | Shared WarpWidget definition, session/env, prefs store, host API (WarpWidgetHost) |
| warpWidgetKit | SPM SwiftUI / WidgetKit package (import warpWidgetKit) — local now, remote later |
| shared | App + demo widgets (counter), shared click handlers, DataStore |
| androidApp | Android host app + Glance widget |
| iosApp | iOS host app + Counter Widget extension (.systemSmall) |
- warp-runtime README — composing widgets, JSON, click actions
- warp-runtime click guide — handler registry & dispatch
- warp-ui README —
WarpRender,warpRender, iOS WidgetKit setup - warp-widget README —
WarpWidget, session, state, Glance / WidgetKit hosts
| Platform | Renderer | Demo |
|---|---|---|
| Android | Jetpack Glance ✓ | Counter widget ✓ |
| iOS | WidgetKit + SwiftUI ✓ | Counter widget (.systemSmall) ✓ |
| API stability | Early / experimental | — |
- Android:
./gradlew :androidApp:assembleDebug— install app, add Counter widget from launcher - iOS: open iosApp in Xcode, run iosApp, add Counter widget (requires App Group + iOS 17+)
./gradlew :warp-runtime:jvmTest
./gradlew :warp-ui:compileKotlinIosSimulatorArm64
./gradlew :androidApp:assembleDebug- /iosApp — iOS application and Widget Extension entry points
- /shared — shared Kotlin (commonMain, androidMain, iosMain)
- /androidApp — Android application
Learn more about Kotlin Multiplatform.