> ## Documentation Index
> Fetch the complete documentation index at: https://anvil.servicetitan.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started - Android

> Add Anvil2 Android tokens and Compose components to an app.

Anvil2 for Android ships four Gradle modules: `:tokens`, `:icons`, `:illustrations`, and `:components`. Coordinates are `com.servicetitan:anvil2-android-tokens`, `com.servicetitan:anvil2-android-icons`, `com.servicetitan:anvil2-android-illustrations`, and `com.servicetitan:anvil2-android-components`.

Requires JDK 17 or newer and the Android SDK (platform 36). Modules target JVM 17, `compileSdk` / `minSdk` 36 / 26, and the Compose BOM pin listed in the package README.

## Modules

| Module | Coordinates | Contents |
| - | - | - |
| `:tokens` | `com.servicetitan:anvil2-android-tokens` | Generated design tokens (`Anvil2Tokens.Semantic.…`) |
| `:icons` | `com.servicetitan:anvil2-android-icons` | Generated icons, as the `Anvil2Icon` enum |
| `:illustrations` | `com.servicetitan:anvil2-android-illustrations` | Generated illustrations, as the `Anvil2Illustration` enum |
| `:components` | `com.servicetitan:anvil2-android-components` | Jetpack Compose components, built on `:tokens`, `:icons`, and `:illustrations` |

## Add the dependency

In hammer, the sample app substitutes the components coordinate with the local project:

```kotlin theme={null}
implementation("com.servicetitan:anvil2-android-components")
```

Until remote publish lands, depend on the local modules (as the sample does) or publish to Maven Local:

```bash theme={null}
cd packages/anvil2-kotlin
./gradlew publishToMavenLocal -PVERSION=0.0.0-local.1
```

## First composable

```kotlin theme={null}
import androidx.compose.foundation.layout.safeDrawingPadding
import androidx.compose.ui.Modifier
import com.servicetitan.anvil2.components.Anvil2Placeholder

setContent {
    Anvil2Placeholder(Modifier.safeDrawingPadding())
}
```

`Anvil2Placeholder` is a public `@Composable` that accepts an optional `Modifier`. It renders the text “Anvil2” with `Anvil2Tokens.Semantic.Foreground.Color.standard`.

## Working in hammer

```bash theme={null}
pnpm --filter @servicetitan/anvil2-kotlin generate
pnpm --filter @servicetitan/anvil2-kotlin build:android
```

Do not edit generated token sources under `tokens/src/main/kotlin/...` by hand; they come from `packages/carto-tokens`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.