All writing

1 min read

Coil 3.0: Image loading for Compose Multiplatform

Coil 3.0 brings its fast, lightweight image loading pipeline to Android, iOS, JVM, JavaScript, and WebAssembly.

Four screenshots of the Coil sample app running on different platforms

Coil 3.0 is out now with full support for Compose Multiplatform. It supports all major platforms so you can now load images on Android, iOS, JVM, JS, and WASM all with the same common API. It also has a ton of other improvements including:

  • Support for multiple networking libraries (OkHttp and Ktor). Additionally, Coil can now be used without a network dependency if you only need to load local files.
  • Better support for Compose @Preview rendering.
  • Support for Compose Multiplatform Resources loaded via Res.getUri.
  • Better compatibility for rememberAsyncImagePainter with Paparazzi, Roborazzi, and the Compose Preview Screenshot Testing library.
  • Enable restarting the same image request via AsyncImagePainter.restart().
  • Support for custom preview behavior via LocalAsyncImagePreviewHandler.
  • Support for custom disk caching behavior for images loaded from the network via CacheStrategy.

Coil 3.0 uses the same Compose API as Coil 2.0 so it’s easy to load images from the network (or elsewhere) on any platform that Compose Multiplatform supports:

AsyncImage(
    model = "https://www.example.com/image.jpg",
    contentDescription = null,
)

Compose Multiplatform makes it easy to build performant, shared UI apps across all major platforms. Check out the full upgrade guide and enjoy!