Pixel Animation

PreviousNext

A background utility component that renders colorful animation leaves arranged in circular rings. Useful for decorative sections or ambient motion backgrounds.

pixel-animation-default

Installation

pnpm dlx shadcn@latest add https://ui.dalim.in/r/styles/default/pixel-animation.json

Usage

import { PixelAnimation } from "@/components/ui/pixel-animation"
<div className="relative h-screen w-full overflow-hidden">
  <PixelAnimation pixelGap={10} />
</div>

API Reference

Props

PropTypeDefaultDescription
containerWidthstring"100vw"Width of the animation container.
containerHeightstring"100vh"Height of the animation container.
backgroundColorstringundefinedOptional background color (not currently applied to canvas).
pixelGapnumber6Gap between pixels in the grid.
animationSpeednumber0.25Speed multiplier for pixel flickering.
colorHueStartnumberrandomStarting hue value for color generation.
colorHueRangenumber50Range of hues to pick colors from.
maxPixelSizenumbergap * 0.5Maximum pixel square size.
animationDurationnumber360Duration of one full animation cycle (show + hide).
showHintbooleanfalseReserved prop for displaying a hint overlay.
hintTextstring""Hint text content if showHint is enabled.