Background

Warp

Immersive 3D warp effects with animated light beams and perspective grids. Perfect for React applications requiring futuristic backgrounds with Next.js integration and TypeScript support.

Powered by

Loading component...

Installation

npx shadcn@latest add https://www.shadcn.io/registry/warp-background.json
npx shadcn@latest add https://www.shadcn.io/registry/warp-background.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/warp-background.json
bunx shadcn@latest add https://www.shadcn.io/registry/warp-background.json

Features

  • 3D perspective effects using CSS transforms and container queries for immersive depth perception
  • Animated light beams with randomized colors, timing, and trajectories using Framer Motion
  • Customizable parameters controlling beam count, size, duration, and perspective intensity
  • Grid-based layout with dynamic background patterns adapting to beam configurations
  • Motion integration providing smooth animations with configurable delays and durations
  • Responsive adaptation automatically adjusting to container dimensions and viewport changes
  • TypeScript support with complete interface definitions for reliable integration
  • shadcn/ui compatibility seamlessly integrating with Card components and design systems

Use Cases

This free open source React component works well for:

  • Hero sections - Futuristic backgrounds for sci-fi and tech landing pages built with Next.js
  • Product showcases - Immersive 3D effects highlighting innovative products using TypeScript
  • Gaming interfaces - Space-themed backgrounds for game menus and dashboards
  • Tech conferences - Dynamic backgrounds for event websites and presentations using shadcn/ui design
  • Portfolio headers - Eye-catching 3D effects showcasing technical capabilities
  • Brand experiences - Futuristic animations expressing innovation and cutting-edge technology using Tailwind CSS

API Reference

WarpBackground

PropTypeDefaultDescription
childrenReactNodeundefinedContent to display inside the warp container
perspectivenumber100CSS perspective value in pixels for 3D depth effect
beamsPerSidenumber3Number of light beams per side of the container
beamSizenumber5Size of each beam as percentage of container width
beamDelayMaxnumber3Maximum delay in seconds before beam animation starts
beamDelayMinnumber0Minimum delay in seconds before beam animation starts
beamDurationnumber3Duration in seconds for each beam animation cycle
gridColorstring"var(--border)"CSS color value for the grid background pattern
classNamestringundefinedAdditional CSS classes for the container

Implementation Notes

  • Component uses CSS container queries and 3D transforms for perspective effects
  • Light beams animated with Framer Motion using random hue values and aspect ratios
  • Grid patterns created with CSS gradients and positioned using CSS custom properties
  • Beam timing randomized between delayMin and delayMax for natural animation sequences
  • Perspective value controls 3D depth perception (lower values = more dramatic effect)
  • Compatible with shadcn/ui design system and supports content overlay with proper z-indexing
  • Hydration-safe implementation preventing server-client mismatches during SSR
  • Performance optimized using CSS transforms and hardware acceleration for smooth animations