Storytale
Component-driven UI development and story gallery for Compose Multiplatform
This is a fork of Kotlin/Storytale supporting Kotlin 2.3+, Compose Multiplatform 1.10+, AGP 9.1, and Maven Central. It will be archived once upstream is officially released.
Features
- Declarative Kotlin DSL: Declare isolated component previews with
by story, supporting hierarchical grouping and contextual descriptions. - Interactive Parameters: Adjust text, booleans, numbers, and enum parameters in real time with
parameter()without recompiling. - Compile-Time Discovery: Zero reflection; stories are synthesized at compile time via a Kotlin FIR compiler plugin.
- Multiplatform Runners: Launch your gallery natively on Android, iOS, Desktop (JVM), and Web (Wasm) with dedicated Gradle tasks.
Get Started | Your First Story | API Reference ↗
Quick Start
1. Apply the Plugin
In your shared UI module (e.g. :shared OR :app:shared OR :composeApp) build.gradle.kts:
2. Write a Story
Declare a story in src/commonStories/kotlin/:
import androidx.compose.material3.Button
import androidx.compose.material3.Text
import org.jetbrains.compose.storytale.story
val `Primary Action Button` by story(group = "Controls/Buttons") {
val label by parameter("Confirm Purchase")
val isEnabled by parameter(true)
Button(
onClick = {},
enabled = isEnabled
) {
Text(label)
}
}
3. Run the Gallery
Run the gallery on Desktop, Web, Android, or iOS:
Interactive Live Showcase
The gallery running in the browser, built with Compose Multiplatform for WebAssembly (wasmJs):
Documentation
- Installation: Repository setup, Gradle configuration, and platform compatibility.
- Writing Your First Story: Step-by-step setup using a standard project from kmp.new.
- Parameters & State: Expose dynamic controls for text, booleans, and lists.
- Decorators & Theming: Wrap stories with custom themes, padding, and composition locals.
- Multiplatform Workflows: Dedicated commands and packaging details for each platform.