uibrik

Stack Flow

Preview

Customize

Speed0.60/s
forward
Gap400px
Spacing9px
Card width208px
Ratio0.66
Rotation50°
Tilt30°
Rounding10px

Usage

import { StackFlow } from "@/components/uibrik/stack-flow/stack-flow";

<StackFlow />

Installation

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

Props

StackFlow
speed
Type number
0.6
Cards that cross the gap every second. Pauses while the pointer is over the stacks.
direction
Type "forward" | "back"
"forward"
Which way the cards cross the gap.
gap
Type number
400
Length of the open gap between the two stacks.
spacing
Type number
9
Space between neighbouring cards inside a stack.
cardWidth
Type number
208
Card width.
ratio
Type number
0.66
Card height against its width.
rotation
Type number
50
How far the row turns away from you.
tilt
Type number
30
How far the row leans back, which sets how steeply it climbs.
rounding
Type number
10
Corner radius of a card.
cards
Type { src: string; alt: string }[]
5 sample cards
The cards, in order. They repeat to fill the row.
count
Type number
–
Cards in the row. Leave out to fit as many as the stage needs.
className
Type string
–
Classes for the wrapper.