Getting Started
Blocks
Components
Device Mocks
Special Effects
Animations
Text Animations
Buttons
Grid BEAMS
import { GridBeams } from "@/registry/magicui/grid-beams";
export function GridBeamsDemo() {
return (
<div className="relative h-[500px] w-full overflow-hidden rounded-lg border">
<GridBeams
gridSize={0}
gridColor="rgba(255, 255, 255, 0.2)"
rayCount={20}
rayOpacity={0.55}
raySpeed={1.5}
rayLength="40vh"
gridFadeStart={5}
gridFadeEnd={90}
className="h-full w-full"
>
<div className="flex h-full items-center justify-center">
<div className="text-center space-y-6 px-4 mt-50">
<h1 className="text-5xl md:text-7xl font-bold text-white leading-tight">
Grid <span className="text-blue-400">BEAMS</span>
</h1>
</div>
</div>
</GridBeams>
</div>
);
}
Installation
pnpm dlx shadcn@latest add @magicui/grid-beams
Usage
import { GridBeams } from "@/components/magicui/grid-beams";
<GridBeams>
<div className="flex h-96 items-center justify-center">
<h2 className="text-2xl font-bold text-white">Grid Beams Effect</h2>
</div>
</GridBeams>
Props
Prop | Type | Default | Description |
---|---|---|---|
children | React.ReactNode | - | Content to display over the grid beams effect |
gridSize | number | 40 | Size of each grid cell in pixels |
gridColor | string | "rgba(200, 220, 255, 0.2)" | Color of the grid lines (CSS color value) |
rayCount | number | 15 | Number of animated light rays |
rayOpacity | number | 0.35 | Opacity of the light rays (0-1) |
raySpeed | number | 1 | Speed multiplier for ray animations |
rayLength | string | "45vh" | Length of the light rays (CSS length value) |
gridFadeStart | number | 30 | Start percentage for grid fade effect |
gridFadeEnd | number | 90 | End percentage for grid fade effect |
backgroundColor | string | "#020412" | Background color of the component |
className | string | - | Additional CSS classes |
Limited Time Offer
Ship Faster with Magic UI ProMagic UI Pro
Stop building from scratch.
Get 8 production-ready templates and 50+ premium components that your users will love.
✓
Next.js 15 + TypeScript ready✓
Copy, paste, customize in minutes✓
Save 100+ hours of development