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.
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
Prop | Type | Default | Description |
---|---|---|---|
children | ReactNode | undefined | Content to display inside the warp container |
perspective | number | 100 | CSS perspective value in pixels for 3D depth effect |
beamsPerSide | number | 3 | Number of light beams per side of the container |
beamSize | number | 5 | Size of each beam as percentage of container width |
beamDelayMax | number | 3 | Maximum delay in seconds before beam animation starts |
beamDelayMin | number | 0 | Minimum delay in seconds before beam animation starts |
beamDuration | number | 3 | Duration in seconds for each beam animation cycle |
gridColor | string | "var(--border)" | CSS color value for the grid background pattern |
className | string | undefined | Additional 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
Vortex
Mesmerizing particle vortex effects with simplex noise algorithms. Perfect for React applications requiring dynamic swirling animations with Next.js integration and TypeScript support.
Waves
Interactive wave animations with cursor-following physics and Perlin noise generation. Perfect for React applications requiring fluid background effects with Next.js integration and TypeScript support.