Image Accordion
Image panels side by side; the hovered or focused one expands and reveals its caption.
- Category: Interactive
- Licence: Charcoal UI Pro
- Built with: React 19, Tailwind CSS 4, Motion
- Dependencies: motion, clsx, tailwind-merge
Examples
Image Accordion
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
panels | { src, title, body }[] | — |
About Image Accordion
Image Accordion lines image panels side by side; the hovered or focused one expands and reveals its caption.
Image Accordion is an interactive effect for React 19, styled with Tailwind CSS 4 and animated with Motion. It drops into Next.js, Vite, Remix or Astro through the shadcn CLI as a single file you own.
When to use Image Accordion
- Destination and travel.
- Product categories.
- Team highlights.
- Feature showcases.
How it works
Panel widths animate with flex and each panel is a focusable button.
Pointer effects have a keyboard or static equivalent, and nothing that matters depends on hover alone. With prefers-reduced-motion on, it holds still or settles instantly instead of animating.
Customizing Image Accordion
Every prop is documented in the API reference above with its type and default. The ones you will reach for first are listed here.
Style it with className like any other element. It only uses your theme's tokens, so it follows light and dark mode without extra work.
- panels ({ src, title, body }[]).
Goes well with Image Accordion
Image Accordion is already composed into a ready-made section, so you can see it in context or install the whole block.
- Gallery Accordion: Gallery section
- Hover Reveal List: A React hover reveal list: hovering a row floats its image beside the pointer
- Pixel Grid: A React pixel grid: cells light up under the pointer and fade slowly
- Draggable Cards: React draggable cards: polaroids scattered on a table you can pick up
- Velocity Marquee: A React velocity marquee: big text that speeds up and flips with scroll
- Stack Cards: React stack cards: cards pin as you scroll and stack on each other
Install Image Accordion
npx shadcn@latest add @charcoal/image-accordionImage Accordion is part of Charcoal UI Pro. One seat unlocks all 300 Pro components, 107 landing-page sections and 100 full templates, for every personal and client project, with updates included. Add the @charcoal registry once with your access token, then the command above copies image-accordion.tsx into components/ui and installs clsx, tailwind-merge.
You own the file you install: no runtime package, no lock-in, nothing to keep in sync. Change it however your product needs.
See Charcoal UI Pro pricing · Pro setup
Frequently asked questions
- Does the image accordion work on mobile?
- Yes. Panels expand on tap as well as hover, and each panel is a focusable button, so keyboard users can open them with Tab and Enter and the caption is read with the image.
- How do I install Image Accordion?
- Image Accordion is part of Charcoal UI Pro. Add the @charcoal registry to components.json with your access token, then run npx shadcn@latest add @charcoal/image-accordion. It copies image-accordion.tsx into components/ui and installs motion, clsx, tailwind-merge.
- Is Image Accordion free for commercial use?
- Image Accordion needs a Charcoal UI Pro seat, monthly or a one-time lifetime price. A seat covers unlimited personal and commercial projects, including client work, and every future Pro component.
- Does Image Accordion work with Next.js?
- Yes. It is a client component for React 19 styled with Tailwind CSS 4, so it works in the Next.js App Router and Pages Router, Vite, Remix and Astro.
- Can an AI coding agent install Image Accordion?
- Yes. Connect the Charcoal UI MCP server (https://charcoalui.com/mcp) to Claude Code, Cursor or any MCP client; get_component returns Image Accordion's props and get_install_command returns the exact command.