ui-image-gallery — Claude Code rule: what it does, how to install
ui-image-gallery directs AI assistants to build image galleries using @nandorojo/galeria instead of custom modal popups.
MIT ★ 1,216 updated 2026-10-24
/plugin marketplace add fcakyon/claude-codex-settings
/plugin install react-skills@claude-settingsWhat ui-image-gallery does
The rule instructs coding assistants to avoid standard Modal implementations when creating fullscreen image viewers. Instead, it guides the model toward @nandorojo/galeria, giving mobile apps native shared element transitions and pinch gestures.
The included patterns cover integration with expo-image, SolitoImage, React Native's Image, and grid layouts using FlashList. It also demonstrates passing low-resolution thumbnail URLs into the grid while loading full-size files on fullscreen tap.
Your React Native or Expo project must have @nandorojo/galeria installed for the generated components to run.
What it helps with
- replace custom modal code with gesture-ready image viewers
- add native shared element transitions to photo galleries
- connect FlashList photo grids to lightbox overlays
- render low-resolution preview images before displaying full assets
Example prompts for the agent
- Create an avatar component that opens fullscreen on tap using Galeria
- Build a 3-column photo grid with FlashList and Galeria lightbox
- Implement an image gallery using expo-image and low-res thumbnails
How to install ui-image-gallery
1Plugin marketplace
/plugin marketplace add fcakyon/claude-codex-settings/plugin install react-skills@claude-settings2Manually: put the files in place
.claude/rules/ui-image-gallery.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/ui-image-gallery.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/ui-image-gallery.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/ui-image-gallery.mdManually: put the files in place
.clinerules/ui-image-gallery.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about ui-image-gallery
How to install ui-image-gallery in Claude Code?
Run /plugin marketplace add fcakyon/claude-codex-settings in Claude Code, then run /plugin install react-skills@claude-settings. Alternatively, place the file in .claude/rules/ui-image-gallery.md.
What does the ui-image-gallery rule do?
It stops the model from scaffolding boilerplate Modal components for image viewers, enforcing @nandorojo/galeria instead.
Which image libraries are compatible with this rule?
It supports expo-image, SolitoImage, default React Native Image, or any other custom image component.
Source text
ui-image-gallery.md · MIT
---
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<string | null>(null)
return (
<>
{urls.map((url) => (
<Pressable key={url} onPress={() => setSelected(url)}>
<Image source={{ uri: url }} style={styles.thumbnail} />
</Pressable>
))}
<Modal visible={!!selected} onRequestClose={() => setSelected(null)}>
<Image source={{ uri: selected! }} style={styles.fullscreen} />
</Modal>
</>
)
}
```
**Correct (Galeria with expo-image):**
```tsx
import { Galeria } from '@nandorojo/galeria'
import { Image } from 'expo-image'
function ImageGallery({ urls }: { urls: string[] }) {
return (
<Galeria urls={urls}>
{urls.map((url, index) => (
<Galeria.Image index={index} key={url}>
<Image source={{ uri: url }} style={styles.thumbnail} />
</Galeria.Image>
))}
</Galeria>
)
}
```
**Single image:**
```tsx
import { Galeria } from '@nandorojo/galeria'
import { Image } from 'expo-image'
function Avatar({ url }: { url: string }) {
return (
<Galeria urls={[url]}>
<Galeria.Image>
<Image source={{ uri: url }} style={styles.avatar} />
</Galeria.Image>
</Galeria>
)
}
```
**With low-res thumbnails and high-res fullscreen:**
```tsx
<Galeria urls={highResUrls}>
{lowResUrls.map((url, index) => (
<Galeria.Image index={index} key={url}>
<Image source={{ uri: url }} style={styles.thumbnail} />
</Galeria.Image>
))}
</Galeria>
```
**With FlashList:**
```tsx
<Galeria urls={urls}>
<FlashList
data={urls}
renderItem={({ item, index }) => (
<Galeria.Image index={index}>
<Image source={{ uri: item }} style={styles.thumbnail} />
</Galeria.Image>
)}
numColumns={3}
estimatedItemSize={100}
/>
</Galeria>
```
Works with `expo-image`, `SolitoImage`, `react-native` Image, or any image
component.
Reference: [Galeria](https://github.com/nandorojo/galeria)
© fcakyon · MIT · fcakyon/claude-codex-settings