expect-actual-composable-capability

Installation
SKILL.md

Platform capabilities as composable expect functions

Three shapes cover almost everything, and they are worth telling apart because each fails differently:

@Composable expect fun getScreenSizeInfo(): ScreenSizeInfo   // a measurement
@Composable expect fun KeepScreenOn()                        // an effect with an undo
@Composable expect fun rememberIsInPipMode(): Boolean        // a subscription, read as state

Every declared type is a common type: the measurement returns a small data class declared in the shared module, not a platform window object. That is the whole point — callers in shared code stay free of platform types, and the platform detail lives in exactly one file per target.

A capability one platform lacks still gets a full actual. It returns the neutral value:

Installs
9
GitHub Stars
1.5K
First Seen
Aug 30, 2026