Installation

Learn how to use Compose Unstyled in a new or existing projects.

Quick Start

The fastest way to start a new project with Compose Unstyled is by using an app boilerplate:


Add to an existing project

Add Maven Central

We distribute Compose Unstyled via Maven Central. Maven Central is the most popular repository for Kotlin packages and it should be included in your list of repositories out of the box.

To make sure you have it, check your settings.gradle.kts:

// settings.gradle.kts
dependencyResolutionManagement {
    repositories {
        mavenCentral() // <- Add this
    }
}

Add to Compose Multiplatform project

For Compose Multiplatform apps:

// composeApp/build.gradle.kts
kotlin {
    androidTarget {
        compilerOptions {
            jvmTarget.set(JvmTarget.JVM_17) // <- Update this
        }
    }
    sourceSets {
        commonMain.dependencies {
            // adds all APIs (recommended for bootstrapping new projects)
            implementation("com.composables:composeunstyled:1.49.2")
            
            // adds theming APIs
            implementation("com.composables:composeunstyled-theming:1.49.2")

            // adds component primitives for building components
            implementation("com.composables:composeunstyled-primitives:1.49.2")

            // adds themes for native look and feel
            implementation("com.composables:composeunstyled-platformtheme:1.49.2")
        }
    }
}

Add to Jetpack Compose project

Add the dependency in your project, and set JVM version to 17:

// app/build.gradle.kts
android {
    kotlinOptions {
        jvmTarget = "17" // <- Update this
    }
    compileOptions {
        // make sure these are set to VERSION_17
        sourceCompatibility = JavaVersion.VERSION_17
        targetCompatibility = JavaVersion.VERSION_17
    }
    // keep the rest the same
}

dependencies {
    // adds all APIs (recommended for bootstrapping new projects)
    implementation("com.composables:composeunstyled:1.49.2")

    // adds theming APIs
    implementation("com.composables:composeunstyled-theming:1.49.2")

    // adds component primitives for building components
    implementation("com.composables:composeunstyled-primitives:1.49.2")

    // adds themes for native look and feel
    implementation("com.composables:composeunstyled-platformtheme:1.49.2")
}