Style guidelines for Jetpack Compose APIs
Stay organized with collections
Save and categorize content based on your preferences.
If you're writing Compose code for your app or building Compose libraries and
APIs, follow best practices to make your code scalable, more performant, and
consistent with the rest of the ecosystem.
The following documents provide guidelines for anyone writing code that uses
Compose:
- API Guidelines for Jetpack Compose: Outlines patterns, best
practices, and prescriptive style guidelines for any system using the Jetpack
Compose compiler plugin and runtime. It includes the following topics:
- Kotlin style guidelines for Compose, based on the Kotlin Coding
Conventions
- Guidance for
@Composable
functions and APIs that build on the Compose
runtime capabilities
- Guidelines for APIs that use and extend the Compose UI toolkit
- Patterns for addressing use cases when designing a Compose API
- API Guidelines for
@Composable
components in Jetpack Compose:
Provides a set of guidelines and recommendations for creating and using
@Composable
UI components, including the following topics:
- Creating and layering components
- Naming a new component
- Expressing component dependencies
- Parameters in
@Composable
components
- Following correct patterns for creating component-related classes and
functions
- Documenting
@Composable
components
- Improving accessibility for components
- Updating component APIs while retaining backwards compatibility
Audience
These guidelines are written for the following three audiences:
- Developers building apps based on Jetpack Compose. You are in this group
if you use Jetpack Compose in some part of your app.
- Developers working on Jetpack Compose framework development. You are in
this group if you make contributions to the
androidx.compose
libraries.
- Developers creating libraries based on Jetpack Compose. You are in this
group if you create Compose APIs or libraries of Compose UI elements. These
libraries of Compose components may be publicly available or local to your
company or team.
Depending on the group you're in, you have different strictness levels for each
style guideline. For example, Jetpack Compose framework development generally
adheres most strictly to these guidelines.
For more information about the requirements for each developer audience, see
RFC2119.
Contribute to framework and guidelines
We welcome contributions to select libraries in the androidx
codebase and the
style guidelines (Compose API guidelines and
@Composable
components guidelines) themselves.
To contribute, follow the instructions in the androidx
contribution
guide.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-09-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[],[],null,["If you're writing Compose code for your app or building Compose libraries and\nAPIs, follow best practices to make your code scalable, more performant, and\nconsistent with the rest of the ecosystem.\n\nThe following documents provide guidelines for anyone writing code that uses\nCompose:\n\n- [API Guidelines for Jetpack Compose](https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-api-guidelines.md): Outlines patterns, best practices, and prescriptive style guidelines for any system using the Jetpack Compose compiler plugin and runtime. It includes the following topics:\n - Kotlin style guidelines for Compose, based on the [Kotlin Coding\n Conventions](https://kotlinlang.org/docs/coding-conventions.html)\n - Guidance for `@Composable` functions and APIs that build on the Compose runtime capabilities\n - Guidelines for APIs that use and extend the Compose UI toolkit\n - Patterns for addressing use cases when designing a Compose API\n- [API Guidelines for `@Composable` components in Jetpack Compose](https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-component-api-guidelines.md): Provides a set of guidelines and recommendations for creating and using `@Composable` UI components, including the following topics:\n - Creating and layering components\n - Naming a new component\n - Expressing component dependencies\n - Parameters in `@Composable` components\n - Following correct patterns for creating component-related classes and functions\n - Documenting `@Composable` components\n - Improving accessibility for components\n - Updating component APIs while retaining backwards compatibility\n\nAudience\n\nThese guidelines are written for the following three audiences:\n\n- **Developers building apps based on Jetpack Compose**. You are in this group if you use Jetpack Compose in some part of your app.\n- **Developers working on Jetpack Compose framework development** . You are in this group if you make contributions to the [`androidx.compose` libraries](/jetpack/androidx/releases/compose).\n- **Developers creating libraries based on Jetpack Compose**. You are in this group if you create Compose APIs or libraries of Compose UI elements. These libraries of Compose components may be publicly available or local to your company or team.\n\nDepending on the group you're in, you have different strictness levels for each\nstyle guideline. For example, Jetpack Compose framework development generally\nadheres most strictly to these guidelines.\n\nFor more information about the requirements for each developer audience, see\n[RFC2119](https://www.ietf.org/rfc/rfc2119.txt).\n\nContribute to framework and guidelines\n\nWe welcome contributions to select libraries in the `androidx` codebase and the\nstyle guidelines ([Compose API guidelines](https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-api-guidelines.md) and\n[`@Composable` components guidelines](https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-component-api-guidelines.md)) themselves.\n\nTo contribute, follow the instructions in the `androidx` [contribution\nguide](https://android.googlesource.com/platform/frameworks/support/+/androidx-main/CONTRIBUTING.md)."]]