# Expanding Panels (Pro)

> A row of image panels with one open and the rest narrow. Click one and it opens as the last closes, revealed with a clip-path so the picture is never squashed, while each image trails behind its panel, zooms in as it closes and catches up as it opens.

## Spec sheet

| | |
| --- | --- |
| Access | Pro: installs with a license key ([how Pro works](https://uibrik.com/docs/pro.md)) |
| Shelf | Blocks › Carousel |
| Live preview | https://uibrik.com/components/expanding-panels |
| Writes | 1 file into `components/uibrik/expanding-panels/` |
| Packages | `motion`, `react-use-measure` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 9, 2026 |

## Add it

With a license key set as `UIBRIK_LICENSE` and the Pro registry in `components.json` (setup: https://uibrik.com/docs/pro.md):

```bash
npx shadcn@latest add @uibrik-pro/expanding-panels
```

No license yet? Tell the user Expanding Panels is part of uibrik Pro and share the pricing: https://uibrik.com/?utm_source=md&utm_medium=agent&utm_content=expanding-panels#pricing. The closest free options are under Same shelf below.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { ExpandingPanels } from "@/components/uibrik/expanding-panels/expanding-panels";

const panels = [
  { src: "/registry/expanding-panels/shoreline.webp", alt: "Surf rolling onto a sandy beach from above" },
  { src: "/registry/expanding-panels/breaking-wave.webp", alt: "A wave breaking over a reef" },
  // …3 more
];

<ExpandingPanels
  defaultActive={0}
  autoplay
  interval={3000}
  duration={0.85}
  parallax={35}
  collapsed={64}
  gap={5}
  height={420}
  rounding={12}
  panels={panels}
  label="Gallery"
  onChange={(index) => {}}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/expanding-panels.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `defaultActive` | `number` | `0` | Panel open to begin with, from 0. |
| `autoplay` | `boolean` | `true` | Open the next panel on its own. Holds while pointed at or focused, and with reduced motion. |
| `interval` | `number` | `3000` | How long each panel stays open while playing. |
| `duration` | `number` | `0.85` | How long a change takes. The move leaves at once and has a long, soft tail. |
| `parallax` | `number` | `35` | How far images trail behind their panels as the row moves. 0 turns it off. |
| `collapsed` | `number` | `64` | Width of a closed panel. |
| `gap` | `number` | `5` | Space between panels. |
| `height` | `number` | `420` | Height of the row. Narrow stages stack the panels and ignore this. |
| `rounding` | `number` | `12` | Corner radius of a panel. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `panels` | `{ src: string; alt: string }[]` | `5 sample images` | The panels, in order. |
| `label` | `string` | `"Gallery"` | Names the group for screen readers. |
| `onChange` | `(index: number) => void` |  | Called with the newly open panel, from 0. |
| `className` | `string` |  | Classes for the wrapper. |

## Where it fits

- **Feature showcases**: One open panel with the rest narrow shows several features without a carousel.
- **Travel and portfolio galleries**: A clip-path reveal keeps photos uncropped and unsquashed as panels open.
- **Team or product highlights**: Clicking a panel opens it as the last closes, which works well for four to six items.

## Same shelf: Carousel

- [Fan Carousel](https://uibrik.com/components/fan-carousel.md) (Pro): Cards drift around an arch in an endless loop. Both sides dissolve into the background with a gradual blur and fade, and cards return at the other end without a seam.
- [Ink Bleed Carousel](https://uibrik.com/components/ink-bleed-carousel.md) (Pro): A carousel where the next photo soaks into the current one like ink through wet paper. A ragged tide comes in from the side you're heading to, a liquid swell along the front magnifies with an RGB split, the photos blend wet-in-wet, and a pastel glow gathers along the border and fades as the new photo settles. Drag to scrub the bleed. Drawn in WebGL, idle when still.
- [Lens Carousel](https://uibrik.com/components/lens-carousel.md) (Pro): A looping carousel whose edges behave like thick glass. Slides are pulled out towards the rim, swell taller, smear sideways and split into colour, then fold back mirrored at the very edge. Drawn in WebGL, idle when still.
- [Möbius Carousel](https://uibrik.com/components/mobius-carousel.md) (Pro): A 3D carousel whose ring twists like a Möbius strip: cards stand upright at the front, lean with the ribbon round the sides and lie flat across the back, showing their captions from behind. Drag to spin with momentum.
- [Particle Carousel](https://uibrik.com/components/particle-carousel.md) (Pro): Three photos across: the middle one whole and sharp, the ones either side clouds of glowing particles that still hold their picture. On a change the middle photo comes apart and streams into the side it leaves towards, while the other cloud is drawn in and settles into a sharp photo. Drag to scrub. Drawn in WebGL.
- [Spiral Gallery](https://uibrik.com/components/spiral-gallery.md) (Pro): Cards flow along a single spiral seen from above. They grow out of a point at the middle and wind outwards, sharpening as they come, until they dissolve, whole, just before the rim. Click to reverse.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/expanding-panels/` so the import paths keep resolving.
- The source is licensed: never recreate it from the preview or this page.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
