Using the Bill of Materials

The Compose Bill of Materials (BOM) lets you manage all of your Compose library versions by specifying only the BOM’s version. The BOM itself has links to the stable versions of the different Compose libraries, in such a way that they work well together. When using the BOM in your app, you don't need to add any version to the Compose library dependencies themselves. When you update the BOM version, all the libraries that you're using are automatically updated to their new versions.

To find out which Compose library versions are mapped to a specific BOM version, check out the BOM to library version mapping.

Why isn't the Compose Compiler library included in the BOM?

The Compose Kotlin compiler extension (androidx.compose.compiler) is not linked to the Compose library versions. Instead, it is linked to versions of the Kotlin compiler plugin and released in a separate cadence from the rest of Compose, so make sure to use a version that is compatible with your version of Kotlin. You can find the Kotlin version that maps to each version of the plugin at Compose to Kotlin Compatibility Map.

How do I use a different library version than what's designated in the BOM?

In the build.gradle dependencies section, keep the import of the BOM platform. On the library dependency import, specify the desired version. For example, here's how to declare dependencies if you want to use an alpha version of Material 3, no matter what version is designated in the BOM:

dependencies {
    // Import the Compose BOM
    implementation platform('androidx.compose:compose-bom:2024.02.01')

    // Import Material Design 3 library
    implementation 'androidx.compose.material3:material3:1.1.2'

    // Import other Compose libraries without version numbers
    // ..
    implementation 'androidx.compose.foundation:foundation'
}

Does the BOM automatically add all the Compose libraries to my app?

No. To actually add and use Compose libraries in your app, you must declare each library as a separate dependency line in your module (app-level) Gradle file (usually app/build.gradle).

Using the BOM ensures that the versions of any Compose libraries in your app are compatible, but the BOM doesn't actually add those Compose libraries to your app.

Going forward, Compose libraries will be versioned independently, which means version numbers will start to be incremented at their own pace. The latest stable releases of each library are tested and guaranteed to work nicely together. However, finding the latest stable versions of each library can be difficult, and the BOM helps you to automatically use these latest versions.

Am I forced to use the BOM?

No. You can still choose to add each dependency version manually. However, we recommend using the BOM as it will make it easier to use all of the latest stable versions at the same time.

Does the BOM work with version catalogs?

Yes. You can include the BOM itself in the version catalog, and omit the other Compose library versions:

[libraries]
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "androidxComposeBom" }
androidx-compose-foundation = { group = "androidx.compose.foundation", name = "foundation" }

Don’t forget to import the BOM in your module’s build.gradle:

dependencies {
    val composeBom = platform(libs.androidx.compose.bom)
    implementation(composeBom)
    androidTestImplementation(composeBom)

    // import Compose dependencies as usual
}

How do I report an issue or offer feedback on the BOM?

You can file issues on our issue tracker.