Background Boxes

Motion

A React background of skewed hairline boxes where the box under the pointer lights up in colour and fades out, driven by one pointer handler and CSS transitions.

src/registry/premium/background-boxes.tsx/r/background-boxes.json

Installation#

bash
npx shadcn@latest add @minidev/background-boxes

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/background-boxes.json

Usage#

tsx
import { BackgroundBoxes } from "@/components/ui/background-boxes"

export function Example() {
  return <BackgroundBoxes />
}

API reference#

BackgroundBoxes props
PropTypeDefault
densitynumber1
colorsstring[]["var(--accent)", "var(--accent-2)", ...
fadenumber1.6
idlenumber2
skew[number, number][-24, 12]
classNamestring-
childrenReact.ReactNode-

Dependencies#

npm

lucide-reactmotion

Built from

All Animated React components