Modules and Targets
Modules
Section titled “Modules”preview-annotationExposes@ComposePreview,@PreviewParam,PreviewGroup,PreviewTag, and variant-group marker types.preview-kspScans source during KSP and generates the registry and parameter form code.preview-runtimeHosts the browser UI, config DSL, registry DSL, state model, and platform-specific host APIs.sampleSmall Android sample showing the default host flow.
Host targets
Section titled “Host targets”- Recommended: Android app or internal tools module
- Supported in shared code: declaring previews from
commonMain - Experimental: wasm/browser runtime in
preview-runtime - Not currently supported: desktop-native or iOS browser hosts
Architectural model
Section titled “Architectural model”- Annotations describe previews in normal source.
- KSP generates a registry at build time.
- The runtime renders the registry and merges config, overrides, and parameter state at runtime.
This keeps preview discovery static while leaving the browser behavior highly configurable.