Skip to content

Installation

Add the Monaka dependencies to your module's build.gradle.kts.

Core library

implementation("dev.gmvalentino.monaka:monaka:<version>")

Required for all targets. Provides State, Action, Effect, Store, the store { } DSL, stateMachine { }, StateMachineStore, plugins, and the relay/bridge API.

Compose integration

implementation("dev.gmvalentino.monaka:monaka-compose:<version>")

Provides the Compose Multiplatform helpers: rememberStore, toViewStore, handleEffects, bindLifecycle, render, ViewStore, and RenderScope. Targets Android, iOS, and JVM. Brings in :monaka transitively. See the Compose integration guide.

Test DSL

// In your commonTest source set
testImplementation("dev.gmvalentino.monaka:monaka-test:<version>")

Provides testStore { } and the assertion DSL (expectState, expectEffect, trigger, …). See the testing guide for usage.

KSP transition processor (optional)

Generates toXxx() / toSelf() extension functions from @Transition and @SelfTransition annotations placed on your state types by the stub generator.

Android / JVM only:

plugins {
    id("com.google.devtools.ksp")
}

dependencies {
    ksp("dev.gmvalentino.monaka:monaka-transitions:<version>")
}

Kotlin Multiplatform: because state types live in commonMain, the setup requires a few extra steps so the generated extensions are visible to all platform compilations. See the KSP setup guide for the full configuration.

Gradle plugin (optional)

plugins {
    id("dev.gmvalentino.monaka")
}

Adds three Gradle tasks for code generation from your state machine DSL. See the Gradle plugin section for full configuration.