Perspective Grid

A 3D-transformed grid background that provides a sense of depth and scale. Perfect for creating'digital horizon'or'cyberpunk'aesthetics with smooth radial fading.

ui

Installation

$npx futureuikit add perspective-grid

Import

import { PerspectiveGrid } from "@/components/ui/perspective-grid"
Layout Variant
Color Theme
Size
Spacing

Named Keys & Props

Pass these exact named keys as props on <PerspectiveGrid />. Click any color pill to copy the prop.

colorDefault is "default"(Black & White)
variantVisual style
"solid""outline""ghost""neon""retro"
shapeCorner shape
"default""square""rounded""sharp"
spacingInner spacing
"default""2x""4x""6x""8x"
sizeComponent size
"sm""md""lg"

Usage Example

A basic implementation example to get you started.

Example Implementation
import { PerspectiveGrid } from"@/components/ui/perspective-grid";

export default function Example() {
 return (
 <div className="w-full h-150 bg-background relative overflow-hidden">
 <PerspectiveGrid 
 gridLineGap={50} 
 fadeRadius={70} 
 />
 <div className="absolute inset-0 flex items-center justify-center">
 <h2 className="text-3xl font-bold italic">Cyber Horizon</h2>
 </div>
 </div>
 );
}

Features

Key capabilities and highlights.

Key Capabilities
  • ◆CSS-based 3D transformation for a futuristic perspective effect.
  • ◆Customizable grid line gap and fading radius.
  • ◆Built-in radial overlay for smooth blending with the background color.
  • ◆Lightweight and performant with zero JavaScript animation overhead.
  • ◆React.memo optimized to prevent unnecessary re-renders.

Notes

Important implementation details to consider.

Implementation Details
  • ◆Install: Run'npx futureuikit add perspective-grid'.
  • ◆Import:'import { PerspectiveGrid } from "@/components/ui/perspective-grid";'
  • ◆Implementation: Best used as the bottom-most layer in hero sections or section dividers.
  • ◆Variants: Adjust'gridLineGap'to change the perspective scale (lower = denser grid).
  • ◆Fading: Use'fadeRadius'to control the radial gradient mask intensity (center vs edges).