To use jetpack compose icons, call the Icon composable from Material 3 and give it an ImageVector, a Painter or an ImageBitmap. Built-in Material icons come from Icons.Default, Icons.Filled and the other Icons themes, while your own vector drawables load with painterResource. Always supply a contentDescription unless the icon is purely decorative.
The examples use Kotlin and Compose Material 3. The Material Icons library is a separate dependency, so check your build.gradle.kts before you start.
Icon draws a vector or bitmap and tints it with the current content color.
By default the icon is 24 dp and tinted with LocalContentColor, which Material containers such as Button and Surface set for you. That is why an icon inside a button automatically matches the button text color.
The core Material icons (Add, Close, Menu, Search, Favorite and a few dozen more) ship in androidx.compose.material:material-icons-core, which is included transitively by the Material 3 library. The full set of thousands of icons lives in material-icons-extended.
Check the current version in your Compose BOM, and do not add a version number if you already use the BOM. The extended library is large. In release builds R8 strips unused icons, but it can slow debug builds and syncs, so many teams copy only the vectors they need into their project instead.
Icons exposes several styles as nested objects.
| Style | Access | Look |
|---|---|---|
| Filled (default) | Icons.Default.Home or Icons.Filled.Home | Solid shapes |
| Outlined | Icons.Outlined.Home | Line only |
| Rounded | Icons.Rounded.Home | Soft rounded corners |
| Sharp | Icons.Sharp.Home | Square corners |
| Two-tone | Icons.TwoTone.Home | Filled with a lighter accent |
Each style needs its own import, for example androidx.compose.material.icons.outlined.Home. Pick one style per app so screens look consistent.
Export an SVG into Android Studio with Vector Asset Studio (New, then Vector Asset). It creates an XML file in res/drawable. Load it with painterResource.
painterResource works for vector drawables and for bitmaps such as PNG files. For multicolor artwork like a logo, set tint = Color.Unspecified so the original colors are kept, because Icon otherwise paints everything in the content color.
tint overrides the content color for one icon. Modifier.size changes the dimensions. Prefer theme colors so the icon adapts to dark mode.
A bare Icon is not clickable. Wrap it in IconButton, which gives a 48 dp touch target, a ripple and the right accessibility role.
Never put Modifier.clickable on a small Icon alone, because the touch target stays 24 dp, which is below the recommended 48 dp. Material 3 also provides FilledIconButton, OutlinedIconButton and IconToggleButton for stateful cases.
Many components take icon slots directly.
Here contentDescription = null is correct because the text already describes the action. Text fields use leadingIcon and trailingIcon parameters in the same way.
Most often the material-icons-extended dependency is missing for an icon outside the core set, or the style import is wrong. Add the dependency and import the exact style path.
A short phrase describing the action or meaning, such as "Delete item". Use null only when the icon is decorative or a visible label already says the same thing.
Convert them to vector drawable XML with Vector Asset Studio and load them with painterResource. Compose does not render raw SVG files from resources.
Set tint = Color.Unspecified on the Icon, or use an Image composable, which does not tint at all.
Icon takes an ImageVector, Painter or ImageBitmap and tints it with the content color.material-icons-extended.painterResource, and use tint = Color.Unspecified for multicolor icons.IconButton and always write a meaningful contentDescription.