coil-compose▌
new-silvermoon/awesome-android-agent-skills · updated Apr 8, 2026
When implementing image loading in Jetpack Compose, use Coil (Coroutines Image Loader). It is the recommended library for Compose due to its efficiency and seamless integration.
Coil for Jetpack Compose
Instructions
When implementing image loading in Jetpack Compose, use Coil (Coroutines Image Loader). It is the recommended library for Compose due to its efficiency and seamless integration.
1. Primary Composable: AsyncImage
Use AsyncImage for most use cases. It handles size resolution automatically and supports standard Image parameters.
AsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data("https://example.com/image.jpg")
.crossfade(true)
.build(),
placeholder = painterResource(R.drawable.placeholder),
error = painterResource(R.drawable.error),
contentDescription = stringResource(R.string.description),
contentScale = ContentScale.Crop,
modifier = Modifier.clip(CircleShape)
)
2. Low-Level Control: rememberAsyncImagePainter
Use rememberAsyncImagePainter only when you need a Painter instead of a composable (e.g., for Canvas or Icon) or when you need to observe the loading state manually.
[!WARNING]
rememberAsyncImagePainterdoes not detect the size your image is loaded at on screen and always loads the image with its original dimensions by default. UseAsyncImageunless aPainteris strictly required.
val painter = rememberAsyncImagePainter(
model = ImageRequest.Builder(LocalContext.current)
.data("https://example.com/image.jpg")
.size(Size.ORIGINAL) // Explicitly define size if needed
.build()
)
3. Slot API: SubcomposeAsyncImage
Use SubcomposeAsyncImage when you need a custom slot API for different states (Loading, Success, Error).
[!CAUTION] Subcomposition is slower than regular composition. Avoid using
SubcomposeAsyncImagein performance-critical areas likeLazyColumnorLazyRow.
SubcomposeAsyncImage(
model = "https://example.com/image.jpg",
contentDescription = null,
loading = {
CircularProgressIndicator()
},
error = {
Icon(Icons.Default.Error, contentDescription = null)
}
)
4. Performance & Best Practices
- Singleton ImageLoader: Use a single
ImageLoaderinstance for the entire app to share the disk/memory cache. - Main-Safe: Coil executes image requests on a background thread automatically.
- Crossfade: Always enable
crossfade(true)inImageRequestfor a smoother transition from placeholder to success. - Sizing: Ensure
contentScaleis set appropriately to avoid loading larger images than necessary.
5. Checklist for implementation
- Prefer
AsyncImageover other variants. - Always provide a meaningful
contentDescriptionor set it tonullfor decorative images. - Use
crossfade(true)for better UX. - Avoid
SubcomposeAsyncImagein lists. - Configure
ImageRequestfor specific needs like transformations (e.g.,CircleCropTransformation).
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.5★★★★★39 reviews- ★★★★★Henry Anderson· Dec 20, 2024
Keeps context tight: coil-compose is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Charlotte Martin· Dec 20, 2024
Registry listing for coil-compose matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Hiroshi Shah· Nov 11, 2024
coil-compose has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Emma Sethi· Nov 11, 2024
coil-compose fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Hiroshi Brown· Oct 2, 2024
Solid pick for teams standardizing on skills: coil-compose is focused, and the summary matches what you get after install.
- ★★★★★Emma Taylor· Oct 2, 2024
We added coil-compose from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Sakura Jackson· Sep 21, 2024
We added coil-compose from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Emma Iyer· Sep 21, 2024
Solid pick for teams standardizing on skills: coil-compose is focused, and the summary matches what you get after install.
- ★★★★★Yash Thakker· Sep 17, 2024
coil-compose is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Min Haddad· Sep 5, 2024
Keeps context tight: coil-compose is the kind of skill you can hand to a new teammate without a long onboarding doc.
showing 1-10 of 39