Skip to content

Storytale Logo Storytale

Component-driven UI development and story gallery for Compose Multiplatform

Maven Central Kotlin Multiplatform Compose Multiplatform License

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.

Storytale running across Desktop, Web, Android, and iOS

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:

plugins {
  id("io.github.aryapreetam.storytale") version "0.0.7"
}

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)
  }
}

Run the gallery on Desktop, Web, Android, or iOS:

./gradlew :composeApp:jvmStoriesRun
./gradlew :composeApp:wasmJsBrowserStoriesDevelopmentRun
./gradlew :composeApp:androidStoriesRun
# Apple Silicon
./gradlew :composeApp:iosSimulatorArm64StoriesRun

# Intel Mac
./gradlew :composeApp:iosX64StoriesRun

Interactive Live Showcase

The gallery running in the browser, built with Compose Multiplatform for WebAssembly (wasmJs):


Documentation