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

DecayCard

decay-card

Distorts and dissolves an image card according to pointer velocity.

Usage

Basic usage

When the mouse moves quickly across the image, the image is "melted/dissolved" by the turbulent displacement, stops and falls back; children renders text superimposed at the bottom.

Hulian
Dissolve card
tsx
<DecayCard image="/cover.jpg">
  Hulian
  <br />
  Dissolve card
</DecayCard>

Fine particles dissolve

Improved baseFrequency and numOctaves, the noise is denser and the dissolved particles are finer.

Fine noise
tsx
<DecayCard
  image="/cover.jpg"
  baseFrequency={0.04}
  numOctaves={6}
  seed={11}
>
  Fine noise
</DecayCard>

Rough chunks

Reduce baseFrequency, increase maxDisplacement, and dissolve it into a thick, silky texture.

Coarse blocks
tsx
<DecayCard
  image="/cover.jpg"
  baseFrequency={0.008}
  maxDisplacement={600}
  seed={2}
>
  Coarse blocks
</DecayCard>

Size and translation boundaries

width / height controls the card size, and movementBound adjusts the soft border feel that follows the mouse translation.

Mini
tsx
<DecayCard
  image="/cover.jpg"
  width={220}
  height={300}
  movementBound={90}
>
  Mini
</DecayCard>

When to use

Use DecayCard for a highly expressive single image that appears to melt under a fast pointer pass, such as an artistic cover or hero. Use TiltedCard for general 3D tilt, or PixelCard for a pixel-wave background.

Import

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

Props

NameTypeDefaultDescription
widthnumber300Card width in pixels.
heightnumber400Card height in pixels.
imagestring"https://picsum.photos/300/400?grayscale"Built-in grayscale placeholder displaced by pointer speed; replace it with a product asset.
altstring""Image alternative; empty treats the image as decorative.
baseFrequencynumber0.015SVG turbulence frequency. Higher values create finer noise; 0.005 to 0.05 is recommended.
numOctavesnumber5Turbulence octave count; more creates detail at higher cost.
seednumber4Random turbulence seed.
maxDisplacementnumber400Peak displacement-map scale.
movementBoundnumber50Soft pointer-translation boundary in pixels.
classNamestring-Class name forwarded to the root.
styleCSSProperties-Inline styles forwarded to the root.

Slots

SlotTypeDescription
childrenReactNodeBottom-aligned copy layered above and unaffected by the image filter.

Usage notes

  • The decay is strongest during fast pointer movement and is minimal on touch. Never use it as the only carrier of information.
  • Large numOctaves and maxDisplacement values make the SVG filter more expensive per frame.
  • Replace the placeholder image in production and provide alt whenever the image is informative.
  • Reduced motion stops the SVG displacement animation and leaves a static image.

Related

Table · Book3D · ProTable · PricingTable · JsonViewer · EditableTable

Playground

Hulian
<DecayCard
  image="/cover.jpg"
  width={300}
  height={400}
  baseFrequency={0.015}
  numOctaves={5}
  maxDisplacement={400}
  movementBound={50}
>
  Hulian
</DecayCard>
PreviousPixelCardData DisplayNextReflectiveCard

On this page

  • Usage
  • Documentation
    • When to use
    • Import
    • Props
    • Slots
    • Usage notes
    • Related
  • Playground