# Color Palette Image Gallery – Extract and Filter by Palette

> Color Palette Image Gallery for React and Tailwind CSS (shadcn/ui): pull a five-color palette out of every photo, then filter photos by color. It is built to let visitors shop by color: pick a real shade in one photo and see which others share it. Use it for mood boards, shop-by-color filters, fashion and interior stores, and portfolios. Hover a photo and its palette fans out like paint chips with HEX labels; press a swatch and matching photos lift with a color dot as the rest sink to grayscale, and a header pill lets you copy the HEX. Palettes come from your data or the built-in color palette extractor (canvas, k-means in OKLab); photos without CORS skip it. The palette picker is controlled or uncontrolled (value, onChange), with onSelect, threshold, columns and labels. Photos are roving-tabindex buttons (arrows move, Enter pins, Escape folds); reduced motion drops transitions, and both themes use shadcn tokens. The included demo autoplays a palette tour over 16 stock photos and makes no requests beyond image loads. Requires React and lucide-react, with no animation library.

- Author: [DHxWhy](https://21st.dev/@dhxwhy)
- License: mit
- Tags: Gallery, Image Gallery, Palette, Color Picker
- npm dependencies: lucide-react
- Live preview: https://21st.dev/@dhxwhy/components/palette-picker-gallery

## Install

```bash
npx shadcn@latest add "https://21st.dev/r/dhxwhy/palette-picker-gallery?api_key=$API_KEY_21ST"
```

Requires a 21st API key (generate one at https://21st.dev/mcp) passed as `API_KEY_21ST`. Free accounts get a limited number of installs per day; unlimited on a paid plan — see https://21st.dev/pricing.

Full component directory: https://21st.dev/llms.txt · More like this: https://21st.dev/community/components/s/gallery.md
