
Iconify catalog icons as Compose UI elements, with network fetching or build-time baking via a Gradle plugin; supports batching, disk caching, preloading, tint/transform, and API client.
Icons from the Iconify catalog for Compose Multiplatform. Targets: Android, iOS, desktop JVM, JS and Wasm.
Not affiliated with the Iconify project.
| Module | Coordinates | Purpose |
|---|---|---|
iconify |
io.github.kraveyard:iconify-compose |
Icons loaded over the network |
iconify-compose-offline |
io.github.kraveyard:iconify-compose-offline |
Runtime for icons baked at build time |
iconify-compose-offline-plugin |
plugin io.github.kraveyard.iconify.compose.offline
|
Gradle plugin that bakes icons |
iconify-api |
io.github.kraveyard:iconify-api |
Client for the Iconify HTTP API |
// settings.gradle.kts
dependencyResolutionManagement {
repositories {
mavenCentral()
}
}// build.gradle.kts
kotlin {
sourceSets {
commonMain.dependencies {
implementation("io.github.kraveyard:iconify-compose:1.0.0")
}
}
}IconifyIcon("tabler:home", contentDescription = "Home")
IconifyIcon("tabler:arrow-right", contentDescription = null, flip = IconifyFlip.Horizontal)
IconifyIcon("tabler:arrow-right", contentDescription = null, rotate = 90)
IconifyIcon("flagpack:us", contentDescription = "United States", tint = Color.Unspecified)Icon(...) is an alias of IconifyIcon(...).
Get a Painter instead:
val painter = rememberIconifyPainter("tabler:home")Load icons ahead of time:
PreloadIconifyIcons(listOf("mdi:home", "mdi:alert"))Wrap your app once:
ProvideIconifyConfig(
baseUrl = "https://api.iconify.design",
tint = MaterialTheme.colorScheme.onSurface,
batching = true,
cache = IconifyCacheConfig(maxSizeBytes = 64L * 1024 * 1024, maxAge = 30.days),
) {
App()
}| Option | Default | Effect |
|---|---|---|
baseUrl |
public Iconify API | Any Iconify compatible server |
imageLoader |
shared loader | Your own Coil ImageLoader
|
tint |
Color.Unspecified |
Default tint. Unspecified keeps icon colors |
batching |
false |
Fetch icons in batches, see below |
cache |
64 MB, 30 days | Disk cache size and expiry |
Off by default. When on, it copies the request batching of the Iconify JS SDK:
/{prefix}.json?icons=a,b,c.Retry-After.Both modes cache icons on disk. Entries expire after maxAge. The least recently used entries are
removed when the cache is full. IconifyCacheConfig(enabled = false) turns it off.
The Gradle plugin downloads icons at build time and generates Kotlin code for them. It adds the runtime dependency itself. The project must use Kotlin Multiplatform.
// build.gradle.kts
plugins {
id("io.github.kraveyard.iconify.compose.offline") version "1.0.0"
}
iconifyOffline {
icons("mdi:home", "tabler:cat")
sets("codicon")
lazy = false
}import io.github.kraveyard.iconify.compose.offline.IconifyIcon
import io.github.kraveyard.iconify.compose.offline.generated.TablerIcons
import io.github.kraveyard.iconify.compose.offline.generated.tablericons.Cat
IconifyIcon(TablerIcons.Cat, contentDescription = null)icons(...) bakes single icons. sets(...) bakes a whole icon set.AllIcons and AllIconsNamed.lazy = true keeps IDE sync offline and fetches before compiling.$GRADLE_USER_HOME/caches/iconify-offline.val api = IconifyApiClient()
val results = api.search(query = "home")
val home = api.iconData(prefix = "mdi", icons = listOf("home")).icons["home"]Covers /search, /collections, /collection, /keywords, /last-modified and
/{prefix}.json.
sample/ is an Android app that browses and searches the whole catalog and shows baked icons.
./gradlew :sample:android:installDebug
imageLoader uses its own disk cache, not IconifyCacheConfig.currentColor in the SVG.sets(...) on a large icon set makes the build fetch and compile a lot of code.Apache 2.0
Icons from the Iconify catalog for Compose Multiplatform. Targets: Android, iOS, desktop JVM, JS and Wasm.
Not affiliated with the Iconify project.
| Module | Coordinates | Purpose |
|---|---|---|
iconify |
io.github.kraveyard:iconify-compose |
Icons loaded over the network |
iconify-compose-offline |
io.github.kraveyard:iconify-compose-offline |
Runtime for icons baked at build time |
iconify-compose-offline-plugin |
plugin io.github.kraveyard.iconify.compose.offline
|
Gradle plugin that bakes icons |
iconify-api |
io.github.kraveyard:iconify-api |
Client for the Iconify HTTP API |
// settings.gradle.kts
dependencyResolutionManagement {
repositories {
mavenCentral()
}
}// build.gradle.kts
kotlin {
sourceSets {
commonMain.dependencies {
implementation("io.github.kraveyard:iconify-compose:1.0.0")
}
}
}IconifyIcon("tabler:home", contentDescription = "Home")
IconifyIcon("tabler:arrow-right", contentDescription = null, flip = IconifyFlip.Horizontal)
IconifyIcon("tabler:arrow-right", contentDescription = null, rotate = 90)
IconifyIcon("flagpack:us", contentDescription = "United States", tint = Color.Unspecified)Icon(...) is an alias of IconifyIcon(...).
Get a Painter instead:
val painter = rememberIconifyPainter("tabler:home")Load icons ahead of time:
PreloadIconifyIcons(listOf("mdi:home", "mdi:alert"))Wrap your app once:
ProvideIconifyConfig(
baseUrl = "https://api.iconify.design",
tint = MaterialTheme.colorScheme.onSurface,
batching = true,
cache = IconifyCacheConfig(maxSizeBytes = 64L * 1024 * 1024, maxAge = 30.days),
) {
App()
}| Option | Default | Effect |
|---|---|---|
baseUrl |
public Iconify API | Any Iconify compatible server |
imageLoader |
shared loader | Your own Coil ImageLoader
|
tint |
Color.Unspecified |
Default tint. Unspecified keeps icon colors |
batching |
false |
Fetch icons in batches, see below |
cache |
64 MB, 30 days | Disk cache size and expiry |
Off by default. When on, it copies the request batching of the Iconify JS SDK:
/{prefix}.json?icons=a,b,c.Retry-After.Both modes cache icons on disk. Entries expire after maxAge. The least recently used entries are
removed when the cache is full. IconifyCacheConfig(enabled = false) turns it off.
The Gradle plugin downloads icons at build time and generates Kotlin code for them. It adds the runtime dependency itself. The project must use Kotlin Multiplatform.
// build.gradle.kts
plugins {
id("io.github.kraveyard.iconify.compose.offline") version "1.0.0"
}
iconifyOffline {
icons("mdi:home", "tabler:cat")
sets("codicon")
lazy = false
}import io.github.kraveyard.iconify.compose.offline.IconifyIcon
import io.github.kraveyard.iconify.compose.offline.generated.TablerIcons
import io.github.kraveyard.iconify.compose.offline.generated.tablericons.Cat
IconifyIcon(TablerIcons.Cat, contentDescription = null)icons(...) bakes single icons. sets(...) bakes a whole icon set.AllIcons and AllIconsNamed.lazy = true keeps IDE sync offline and fetches before compiling.$GRADLE_USER_HOME/caches/iconify-offline.val api = IconifyApiClient()
val results = api.search(query = "home")
val home = api.iconData(prefix = "mdi", icons = listOf("home")).icons["home"]Covers /search, /collections, /collection, /keywords, /last-modified and
/{prefix}.json.
sample/ is an Android app that browses and searches the whole catalog and shows baked icons.
./gradlew :sample:android:installDebug
imageLoader uses its own disk cache, not IconifyCacheConfig.currentColor in the SVG.sets(...) on a large icon set makes the build fetch and compile a lot of code.Apache 2.0