uibrik

Expanding Panels

Preview

Customize

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

Usage

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

<ExpandingPanels />

Installation

npx shadcn@latest add https://uibrik.com/r/expanding-panels.json
Adds the files to components/uibrik/expanding-panels and installs motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/expanding-panels.

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.