Hulian UIv0.93.5413 components0 components
  • Start
  • Components
  • Blocks
  • Pages
  • Demos
  • Changelog
ChineseEnglish
  • ComponentsComponents
  • ThemeTheme

Collections

  • QuestionCard
  • Table
  • Book3D
  • ProTable
  • PricingTable
  • JsonViewer
  • EditableTable
  • List
  • Descriptions
  • RowActions
  • Tree
  • Card
  • Carousel
  • Video
  • Audio
  • BentoGrid
  • Image
  • MagicCard
  • AnimatedList
  • Marquee
  • Sortable
  • Kanban
  • DesignCanvas
  • LayerTree
  • StageDraw
  • SlideDeck
  • PresenterView
  • ComponentPicker
  • EventStream
  • QueueLane
  • DocumentSheet
  • Novel reader
  • Scheduler
  • Org classroom
  • Danmaku
  • LiveChat
  • LivePlayer
  • LogViewer
  • FileTree
  • CodeReviewThread
  • VirtualList
  • InfiniteScroll
  • LogoLoop
  • BounceCards
  • CardSwap
  • ChromaGrid
  • CircularGallery
  • DomeGallery
  • FlyingPosters
  • InfiniteMenu
  • MagicBento
  • ScrollStack
  • ProfileCard
  • TiltedCard
  • PixelCard
  • DecayCard
  • ReflectiveCard
  • Folder

Charts and Diagrams

  • Flow
  • Diagram
  • Paper
  • SequenceDiagram
  • Sankey
  • Sparkline
  • Funnel
  • Treemap
  • Gantt
  • Heatmap
  • ContributionGraph
  • Legend
  • Chart
  • WorldMap

Information

  • ImageViewer
  • LiveProductCard
  • DiffStat
  • ScoreRing
  • ScoreScale
  • Badge
  • Dot
  • StatusDot
  • Chip
  • FilterChip
  • Coupon
  • Tag
  • Annotation
  • Avatar
  • AvatarCircles
  • User
  • QRCode
  • Comment
  • RelativeTime
  • GitCommit
  • DeployStatus
  • ShieldBadge
  • AwardBadge
  • CreditCard
  • IconTile

Metrics

  • Stat
  • Statistic
  • Meter
  • Timeline
  • NumberTicker

Placeholders

  • Empty
  • Skeleton
  • Watermark

BounceCards

bounce-cards

Fans image cards into place with springy hover and entrance motion.

Usage

Basic usage (pictures)

Pass the images array, and each picture is rendered as a card. When entering, the cards will be popped in one by one, hovering and pushed to give way.

01
02
03
04
05
tsx
<BounceCards
  images={["/1.jpg", "/2.jpg", "/3.jpg", "/4.jpg", "/5.jpg"]}
  containerWidth={460}
  containerHeight={240}
/>

Customize card content

Replace images with children, and each child node is rendered into a card (the number determines the number).

01
02
03
04
05
tsx
<BounceCards containerWidth={460} containerHeight={240}>
  <Swatch label="01" />
  <Swatch label="02" />
  <Swatch label="03" />
  <Swatch label="04" />
  <Swatch label="05" />
</BounceCards>

Custom sector + Close hover

transformStyles Customize the rotation/displacement of each card, enableHover={false} turns off push interaction.

01
02
03
tsx
<BounceCards
  containerWidth={420}
  containerHeight={220}
  enableHover={false}
  transformStyles={[
    "rotate(8deg) translate(-110px)",
    "rotate(-2deg)",
    "rotate(-8deg) translate(110px)",
  ]}
>
  {cards.slice(0, 3)}
</BounceCards>

More exaggerated pushing distance

pushDistance Increase the size to make the cards on both sides give way more obviously when hovering.

01
02
03
04
05
tsx
<BounceCards
  containerWidth={460}
  containerHeight={240}
  pushDistance={220}
>
  {cards}
</BounceCards>

When to use

Use BounceCards for a small fanned stack of images or cards that enters sequentially and makes room around the hovered item, often in a marketing hero or album preview. Use CardSwap for an automatically cycling 3D stack, ChromaGrid for a spotlight card wall, or Table for structured data. children take precedence over images.

Import

ts
import { BounceCards } from "@hulianui/ui"

Props

NameTypeDefaultDescription
imagesstring[]-Image URLs aligned by index with transformStyles; mutually exclusive with children.
containerWidthnumber400Container width in pixels.
containerHeightnumber400Container height in pixels.
animationDelaynumber0.5Delay in seconds before entrance begins.
animationStaggernumber0.06Seconds between adjacent card entrances.
transformStylesstring[]Five-card fanPer-card transforms; entries beyond the array receive no transform.
enableHoverbooleantrueWhether the hovered card straightens and neighbors move aside.
pushDistancenumber160Neighbor displacement in pixels.
classNamestring-Root class name.
styleCSSProperties-Root inline styles.

Slots

SlotTypeDescription
childrenReactNode[]Custom cards replacing image rendering; count and transforms align by index.

Example

tsx
<BounceCards containerWidth={460} containerHeight={240}>
  {[<Swatch key="1" label="01" />, <Swatch key="2" label="02" />, <Swatch key="3" label="03" />]}
</BounceCards>

Custom fan without hover:

tsx
<BounceCards enableHover={false} transformStyles={["rotate(8deg) translate(-110px)", "rotate(-2deg)", "rotate(-8deg) translate(110px)"]}>{cards}</BounceCards>

Usage guidelines

  • children override images when both are present.
  • transformStyles align by index. Add transforms for custom card counts or extra cards stack at the origin.
  • animationDelay and animationStagger are seconds, not milliseconds.
  • Reduced motion skips the bounce entrance.

Related

Table · Book3D · ProTable · PricingTable · JsonViewer · EditableTable

Playground

01
02
03
04
05
<BounceCards
  images={["/1.jpg", "/2.jpg", "/3.jpg", "/4.jpg", "/5.jpg"]}
  containerWidth={460}
  containerHeight={240}
  animationDelay={0.5}
  animationStagger={0.06}
  pushDistance={160}
  enableHover={true}
/>
PreviousLogoLoopData DisplayNextCardSwap

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Slots
    • Example
    • Usage guidelines
    • Related
  • Playground