Black Friday: 30% off Pro

Get 30% off

Updated

Expanding Panels

Pro

Preview

Customize

Open panel0
Interval3000ms
Duration0.85s
Parallax35%
Collapsed64px
Gap5px
Height420px
Rounding12px

Installation

Pro

Expanding Panels is a Pro component

Sign in to see the source, or install it with a license key. The live preview and props above are free to explore.

Install with a key

  1. Add the Pro registry to components.json:
    components.json
    {
      "registries": {
        "@uibrik-pro": {
          "url": "https://uibrik.com/r/pro/{name}.json",
          "headers": { "Authorization": "Bearer ${UIBRIK_LICENSE}" }
        }
      }
    }
  2. Put your key in .env.local and add that file to .gitignore:
    .env.local
    UIBRIK_LICENSE=your-license-key
  3. Install it:
    Terminal
    npx shadcn@latest add @uibrik-pro/expanding-panels

Usage

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) => {}}/>

Where to use Expanding Panels

  • 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.

Props

ExpandingPanels
defaultActive
Type number
0
Panel open to begin with, from 0.
autoplay
Type boolean
true
Open the next panel on its own. Holds while pointed at or focused, and with reduced motion.
interval
Type number
3000
How long each panel stays open while playing.
duration
Type number
0.85
How long a change takes. The move leaves at once and has a long, soft tail.
parallax
Type number
35
How far images trail behind their panels as the row moves. 0 turns it off.
collapsed
Type number
64
Width of a closed panel.
gap
Type number
5
Space between panels.
height
Type number
420
Height of the row. Narrow stages stack the panels and ignore this.
rounding
Type number
12
Corner radius of a panel.
panels
Type { src: string; alt: string }[]
5 sample images
The panels, in order.
label
Type string
"Gallery"
Names the group for screen readers.
onChange
Type (index: number) => void
–
Called with the newly open panel, from 0.
className
Type string
–
Classes for the wrapper.