Skip to content

Usage

Create a folder called xml-images in the module folder.

Android

For example, if you're using this plugin in your application module called app, you need to create a folder inside the app folder.

app/xml-images

Captura de pantalla 2024-01-05 a las 16 57 56

Multiplatform

Create a folder called xml-images in the module folder. For example:

common/xml-images

Captura de pantalla 2024-01-05 a las 17 10 28

Generate images

You can manually generate ImageVector for these XML files by calling gradle generateImages. This will create a Kotlin file for each XML file containing the ImageVector in the build folder.

Captura de pantalla 2024-01-05 a las 17 00 45

Now, you can use reference this image in the Compose code:

Icon(Images.Icons.Add, contentDescription = null)

Note that automatically a category called "Icons" has been created. A category is created for each subfolder in xml-images folder.