--- title: Use Galeria for Image Galleries and Lightbox impact: MEDIUM impactDescription: native shared element transitions, pinch-to-zoom, pan-to-close tags: images, gallery, lightbox, expo-image, ui --- ## Use Galeria for Image Galleries and Lightbox For image galleries with lightbox (tap to fullscreen), use `@nandorojo/galeria`. It provides native shared element transitions with pinch-to-zoom, double-tap zoom, and pan-to-close. Works with any image component including `expo-image`. **Incorrect (custom modal implementation):** ```tsx function ImageGallery({ urls }: { urls: string[] }) { const [selected, setSelected] = useState(null) return ( <> {urls.map((url) => ( setSelected(url)}> ))} setSelected(null)}> ) } ``` **Correct (Galeria with expo-image):** ```tsx import { Galeria } from '@nandorojo/galeria' import { Image } from 'expo-image' function ImageGallery({ urls }: { urls: string[] }) { return ( {urls.map((url, index) => ( ))} ) } ``` **Single image:** ```tsx import { Galeria } from '@nandorojo/galeria' import { Image } from 'expo-image' function Avatar({ url }: { url: string }) { return ( ) } ``` **With low-res thumbnails and high-res fullscreen:** ```tsx {lowResUrls.map((url, index) => ( ))} ``` **With FlashList:** ```tsx ( )} numColumns={3} estimatedItemSize={100} /> ``` Works with `expo-image`, `SolitoImage`, `react-native` Image, or any image component. Reference: [Galeria](https://github.com/nandorojo/galeria)