
Tap any image to open a fullscreen lightbox gallery with overlay host, automatic click handling, and easy integration into existing layouts via LightboxHost, PhotoItem and LightboxImage.
An implementation of a Lightbox for Jetpack Compose. Press an image anywhere in your layout to open a gallery of images.
https://github.com/user-attachments/assets/247b350f-be37-4e02-bbbc-dad781d624bb
This library currently supports Android and iOS. For older Android phones, use version 1.x without Multiplatform support.
This library depends on Coil 3 for image loading and display. Follow the Quick Start instructions to connect it a networking library like Ktor or OkHttp.
Once a regular AsyncImage() loads successfully in your app, you can integrate ComposeLightbox.
Add the ComposeLightbox dependency to the build.gradle of your app:
implementation("io.github.x-sheep:compose-lightbox:2.0.0")LightboxHost above your Scaffold, to make sure the overlay covers the entire app screen.PhotoItem objects to describe each image.LightboxImage. This composable will automatically add a Click handler.Simple example:
import io.github.xsheep.composelightbox.*
@Composable
fun Gallery() {
LightboxHost {
Scaffold { padding ->
val photoList = remember {
listOf<PhotoItem>() // Add your photos here
}
LazyColumn(contentPadding = padding) {
items(photoList) {
LightboxImage(photoList, it, Modifier.size(300.dp))
}
}
}
}
}If your layout is changing size when the Lightbox opens and closes, you can try increasing the window insets used in your Scaffold:
Scaffold(contentWindowInsets = WindowInsets.mandatorySystemGestures.union(WindowInsets.displayCutout))Copyright (c) 2025-2026 Lennard Sprong. MIT License
An implementation of a Lightbox for Jetpack Compose. Press an image anywhere in your layout to open a gallery of images.
https://github.com/user-attachments/assets/247b350f-be37-4e02-bbbc-dad781d624bb
This library currently supports Android and iOS. For older Android phones, use version 1.x without Multiplatform support.
This library depends on Coil 3 for image loading and display. Follow the Quick Start instructions to connect it a networking library like Ktor or OkHttp.
Once a regular AsyncImage() loads successfully in your app, you can integrate ComposeLightbox.
Add the ComposeLightbox dependency to the build.gradle of your app:
implementation("io.github.x-sheep:compose-lightbox:2.0.0")LightboxHost above your Scaffold, to make sure the overlay covers the entire app screen.PhotoItem objects to describe each image.LightboxImage. This composable will automatically add a Click handler.Simple example:
import io.github.xsheep.composelightbox.*
@Composable
fun Gallery() {
LightboxHost {
Scaffold { padding ->
val photoList = remember {
listOf<PhotoItem>() // Add your photos here
}
LazyColumn(contentPadding = padding) {
items(photoList) {
LightboxImage(photoList, it, Modifier.size(300.dp))
}
}
}
}
}If your layout is changing size when the Lightbox opens and closes, you can try increasing the window insets used in your Scaffold:
Scaffold(contentWindowInsets = WindowInsets.mandatorySystemGestures.union(WindowInsets.displayCutout))Copyright (c) 2025-2026 Lennard Sprong. MIT License