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

PixelCard

pixel-card

Reveals card content through animated pixel particles.

Usage

Basic usage

When hovering/focusing, the pixels grow ripple-like from the center outwards, shrinking and dissipating frame by frame.

Hulian component library

Hover/focus trigger pixel animation

tsx
<PixelCard variant="default" className="h-48 w-64">
  <div className="flex flex-col items-center gap-1 px-6 text-center">
    <p className="text-base font-semibold text-foreground">Hulian Component Library</p>
    <p className="text-xs text-muted-foreground">Hover/focus trigger pixel animation</p>
  </div>
</PixelCard>

Default variant

variant One-click switch gap / speed / Color combination: blue / pink / amber.

blue

chart-2 Blues

amber

gap=3 Denser and more delicate

tsx
<PixelCard variant="blue" className="h-48 w-64">
  …
</PixelCard>

Customized color matching and speed

colors / gap / speed Pass the value individually to override the variant default, feed token with --color- prefix.

Custom

colors / gap / speed can be covered

tsx
<PixelCard
  colors={[
    "var(--color-chart-5)",
    "var(--color-chart-4)",
    "var(--color-chart-1)",
  ]}
  gap={5}
  speed={18}
  className="h-48 w-64"
>
  …
</PixelCard>

Disable focus triggering

noFocus Only mouse hover triggers the animation, and the root container cannot be keyboard focused.

Hover trigger only

noFocus = true

tsx
<PixelCard variant="default" noFocus className="h-48 w-64">
  …
</PixelCard>

When to use

Use PixelCard as a retro or technical animated background for card content. Use TiltedCard for pointer-driven 3D tilt, or MagicBento for a spotlight grid.

Import

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

Props

NameTypeDefaultDescription
variant"default" | "blue" | "pink" | "amber""default"Preset controlling gap, speed, colors, and focus behavior; explicit props override the preset.
gapnumberVariant defaultPixel spacing in pixels. Smaller values are denser and more expensive; 3 to 12 is recommended.
speednumberVariant defaultAnimation speed from 0 to 100; zero disables animation.
colorsstring[]Variant token colorsColors sampled by pixels. Accepts CSS colors and real Hulian tokens.
noFocusbooleanVariant defaultIf true, only pointer hover triggers and the root is not keyboard-focusable.
classNamestring-Root classes controlling size, radius, and border.
styleCSSProperties-Inline styles forwarded to the root.

Slots

SlotTypeDescription
childrenReactNodeContent layered above the canvas.

Usage notes

  • Set dimensions through className or style; a zero-sized host produces an invisible canvas.
  • Smaller gap values increase the number of pixels and RAF redraw cost.
  • [[hulian-token-color-var-needs-color-prefix]]: use var(--color-chart-2), not bare var(--chart-2), for canvas colors.
  • Reduced motion and speed=0 disable the wave animation.

Related

Table · Book3D · ProTable · PricingTable · JsonViewer · EditableTable

Playground

Pixel Card

Hover to see the effect

<PixelCard
  variant="blue"
  gap={6}
  speed={35}
  noFocus={false}
  className="h-48 w-64"
>
  <div className="text-center">…</div>
</PixelCard>
PreviousTiltedCardData DisplayNextDecayCard

On this page

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