Installation
Composeum publishes three artifacts:
tech.lucam.composeum:preview-annotation:0.3.0tech.lucam.composeum:preview-runtime:0.3.0tech.lucam.composeum:preview-ksp:0.3.0Recommended split:
- Add
preview-annotationto every module that declares previews. - Add
preview-kspto those same modules withksp(...). - Add
preview-runtimeonly to the Android app or internal tools module that hosts the browser.
Preview-declaring module
Section titled “Preview-declaring module”plugins { id("com.google.devtools.ksp")}
dependencies { implementation("tech.lucam.composeum:preview-annotation:0.3.0") ksp("tech.lucam.composeum:preview-ksp:0.3.0")}No KSP arguments are required for the default path. Composeum generates GeneratedPreviewRegistry
under <first preview package>.generated.
Browser host module
Section titled “Browser host module”dependencies { implementation("tech.lucam.composeum:preview-runtime:0.3.0")}Target support
Section titled “Target support”- Stable and recommended: Android hosting via
ComposeumBrowserActivity - Stable: preview declarations from shared
commonMainconsumed by Android builds - Experimental: wasm/browser hosting and opt-in Android Studio
@Previewimport - Unsupported today: iOS and desktop-native browser hosts
Android-only APIs:
ComposeumBrowserActivity- Android
ComposeumBrowser(...)overload DataStoreSettingsStorage@ViewPreview
Shared APIs:
@ComposePreview@PreviewParamPreviewGroupPreviewRegistry- Common
ComposeumBrowser(...)overload