---
title: IconMuse for Android and Jetpack Compose
description: Add IconMuse music icons to an Android app with one command, then use them in Jetpack Compose or Android Views.
---

# IconMuse for Android and Jetpack Compose

One command adds the icons to your Android project as vector drawables. You need [Node.js](https://nodejs.org) 18 or later on your computer to run it; your app itself doesn't use Node.

## 1. Add the icons

In a terminal, go to your project's root folder (the one containing `settings.gradle` or `settings.gradle.kts`):

```bash
cd path/to/your-android-app
npx iconmuse generate --dry-run   # preview what it will add
npx iconmuse generate             # add the icons
```

It finds your app module and writes one vector drawable per icon:

```text
app/src/main/res/drawable/
├── ic_iconmuse_play.xml
├── ic_iconmuse_pause.xml
└── …
```

To add only the icons you need, which keeps your app smaller:

```bash
npx iconmuse generate --icons play,pause,vinyl
```

## 2. Use the icons

```kotlin
// Jetpack Compose
Icon(
    painter = painterResource(R.drawable.ic_iconmuse_play),
    contentDescription = "Play",
    tint = MaterialTheme.colorScheme.primary,
)

// Views (Kotlin)
imageView.setImageResource(R.drawable.ic_iconmuse_headphones)
```

```xml
<!-- Views (XML) -->
<ImageView
    android:src="@drawable/ic_iconmuse_play"
    app:tint="?attr/colorOnSurface" />
```

- **Naming:** resource names are `ic_iconmuse_` followed by the icon name in snake_case, so `guitar-electric` becomes `ic_iconmuse_guitar_electric`.
- **Tinting:** set the colour with `tint` in Compose, or `app:tint` / `android:tint` in Views.

## Line thickness (stroke)

Icons are drawn with a 1.5 line by default. On Android, the thickness is fixed into the drawables when they're generated, so choose it with `--stroke`, using a value between 0.5 and 3:

```bash
npx iconmuse generate --stroke 2      # bolder
npx iconmuse generate --stroke 1      # lighter
```

To change it later, run the command again with a different value. The website's **Stroke** slider shows what each value looks like.

## Updating

Run `npx iconmuse generate` again in the same folder. It only replaces its own `ic_iconmuse_*.xml` files. Include the same `--stroke` value if you used one.

## Finding icon names

Browse them at https://icons.chordmuse.app, or in a terminal:

```bash
npx iconmuse list --search guitar
```
