SVG to Composev2.1.2
Convert SVG and Android Vector Drawables into type-safe Kotlin ImageVector code. CLI, Gradle Plugin, Kotlin Multiplatform.
Try it
Optimize
Minify
KMP Compatible
No Preview
Make Internal
Package Name
Theme
Receiver Type
SourceSVG
Converted
100%
input.svg
MyIcon.kt
Click Convert to see output
input.svg
Install
CLI
Copy
Gradle Plugin
Copy
Usage
Convert a Single File
Convert a single SVG file to a Kotlin ImageVector.
Copy
Batch Convert a Directory
Recursively convert all SVG files in a directory.
Copy
Material Icons Receiver
Generate icons with a Material Icons receiver type.
Copy
FlagTypeDescription
-o, --outputStringOutput file or directory path
-p, --packageStringKotlin package name for generated code
-t, --themeStringFully-qualified theme class name
-opt, --optimizeBooleanEnable SVG/AVG optimization (default: true)
-rt, --receiver-typeStringReceiver type (e.g. Icons.Filled)
--add-to-materialBooleanAdd as extension to Material Icons
-np, --no-previewBooleanSkip generating @Preview composables
--kmpBooleanEnsure output is KMP-compatible (default: false)
--make-internalBooleanMark generated symbols as internal
--minifiedBooleanRemove comments and inline method parameters
-r, --recursiveBooleanRecursively process sub-directories
--recursive-depth, --depthIntDepth level for recursive search (default: 10)
--excludeString...Regex pattern to exclude icons from processing
--map-icon-name-from-toPair...Replace icon name pattern (old to new)
Capabilities
ConversionSVG paths/shapes/groupsAndroid Vector DrawablesLinear & radial gradientsCSS styles & specificityTransforms & clipping
IntegrationGradle plugin (incremental)CLI (macOS/Linux/Windows)Kotlin MultiplatformSVGO/Avocado optimization
Developer Experience@Preview generationCode minificationCustom naming rulesMaterial Icons receiver types