Skip to main content
rule CX Codex

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

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add fcakyon/claude-codex-settings
/plugin install react-skills@claude-settings
Open on GitHub

What 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-settings

2Manually: put the files in place

.claude/rules/ui-image-gallery.md

The paths frontmatter field limits the files

Step 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

Similar IDE rules

All IDE rules for Mobile →

From the same set113

The whole set →
list-performance-inline-objects list-performance-inline-objects — a rule that prevents creating objects inside renderItem for props. Inline objects create new references on every render and break memoization. CX Codex +1 ★ 1,216repo stars setup setup configures Tavily MCP server credentials inside Claude Code and saves them to the plugin configuration. CX Codex +1 ★ 1,216repo stars bundle-analyzable-paths The bundle-analyzable-paths rule recommends making import and file paths statically analyzable. That keeps bundlers from treating a broad set of files as reachable. CX Codex +1 ★ 1,216repo stars list-performance-item-expensive The list-performance-item-expensive rule bans heavy list rows: data queries, extra hooks and React Context reads inside renderItem. CX Codex +1 ★ 1,216repo stars rendering-resource-hints The rendering-resource-hints rule tells the agent when to call React DOM's resource-hint functions inside React components. It targets server components, letting the browser start fetching assets before the client even has the HTML. CX Codex +1 ★ 1,216repo stars animation-gesture-detector-press animation-gesture-detector-press is a React Native rule that keeps press animations on the UI thread, for buttons that scale or fade while pressed. CX Codex +1 ★ 1,216repo stars commit-staged commit-staged automates commit creation: checks staged diffs, runs /simplify on code edits, and writes conventional commits using session rationale. CX Codex +1 ★ 1,216repo stars shell-and-workflows The shell-and-workflows rule documents Docker commands for the project and explains where to run frontend and backend tests. Use it when managing services or checking a change. CX Codex +1 ★ 1,216repo stars

Project sponsors

Companies that keep this analytics open