---
title: IconMuse for Flutter
description: Add IconMuse music icons to a Flutter app with one command, then use IconMuse(IconMuseIcons.play) like Flutter's own Icon widget.
---

# IconMuse for Flutter

One command adds the icons to your Flutter project. 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 app's folder (the one containing `pubspec.yaml`):

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

It writes one file:

```text
your-flutter-app/
└── lib/
    └── iconmuse/
        └── iconmuse.dart    (every icon plus an IconMuse widget)
```

To add only the icons you need:

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

## 2. Add flutter_svg

The icons are drawn with the standard [`flutter_svg`](https://pub.dev/packages/flutter_svg) package. If your app doesn't have it yet, the command tells you. Run:

```bash
flutter pub add flutter_svg
```

## 3. Use the icons

The command prints your exact import line. It looks like this:

```dart
import 'package:your_app/iconmuse/iconmuse.dart';

IconMuse(IconMuseIcons.play)
IconMuse(IconMuseIcons.guitarElectric, size: 32, color: Colors.purple)

IconButton(
  icon: IconMuse(IconMuseIcons.play),
  onPressed: () {},
)

IconMuse(IconMuseIcons.vinyl, semanticLabel: 'Vinyl')   // read out by screen readers
```

- **Theming:** `IconMuse` follows your app's `IconTheme` for size and colour, like Flutter's own `Icon`. It adapts to light and dark mode and works in `IconButton`, `AppBar` and `BottomNavigationBar`.
- **Autocomplete:** names are camelCase (`guitar-electric` becomes `IconMuseIcons.guitarElectric`), and your editor suggests them all.

## Line thickness (stroke)

Icons are drawn with a 1.5 line by default. Change it per icon with `strokeWidth`, using a value between 0.5 and 3:

```dart
IconMuse(IconMuseIcons.play, strokeWidth: 2)     // bolder
IconMuse(IconMuseIcons.play, strokeWidth: 1)     // lighter
```

To change the default for every icon, generate with `--stroke`:

```bash
npx iconmuse generate --stroke 2
```

The website's **Stroke** slider shows what each value looks like.

## Updating

Run `npx iconmuse generate` again in the same folder. It only replaces `lib/iconmuse/iconmuse.dart`. 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 drum
```
