shadcn.io is not affiliated with official shadcn/ui
A glowing neon grid with short beams of light racing along its rows and columns, lighting each crossing they pass, like a Tron floor seen from above. The lines, their glow, the beams and the flares are CSS gradients moved by keyframes the install adds to your stylesheet, and the beams snap to the lines in a box of any size.
Use it for gaming, AI or infrastructure heroes. For a quieter board with traces and slower signals, use Circuit; for a synthwave grid in perspective, Retro Grid; for the grid without motion, Grid Pattern.
Installation
Usage
import { LaserGrid } from "@/components/ui/laser-grid";Laser Grid is a container: give it a size and put your content inside. The grid sits behind the content and the box clips it.
<LaserGrid className="flex min-h-[420px] items-center justify-center">
<h1 className="text-5xl font-semibold">Every packet, at light speed</h1>
</LaserGrid>For a backdrop behind the whole page, leave it empty and fix it under everything else:
<LaserGrid className="fixed inset-0 -z-10" />Demos
Theme colours
By default the grid keeps its signature neon: cyan lines and beams, one beam in five magenta, in light and dark. Pass theme colours to beamColor, accentColor and lineColor to follow your theme instead.
Dense
A tighter grid in a dark card: gridSpacing={32}, count={40} beams and speed={1.5}.
Accessibility
The grid is decorative: it's hidden from screen readers and lets every click through to your content. With reduced motion the grid stops breathing and the beams stop where they are, mid-line, so the page shows a still picture of the grid. Nothing flashes: the grid breathes over more than three seconds and the flares are small moving highlights, not lights switching on and off. The lines are faint (a quarter of the beams' colour), so headline text in your foreground colour stays readable.
FAQ
How do I change the number of beams?
count sets how many race at once (24). They're spread over the rows and columns of whatever box they're in, so they all stay in view, even in a small card.
Can it use my theme's colours instead of neon?
Yes: pass beamColor="var(--primary)", a paler accentColor and a faint lineColor, as in "Theme colours". You can also set --laser-grid-beam-color, --laser-grid-accent-color and --laser-grid-line-color from your own CSS; the lines follow the beams' colour unless you set them.
How do I make the grid tighter?
gridSpacing sets the distance between lines in pixels (64). The beams snap to the lines at any spacing and in a box of any size.
How do I get the original dark Tron look?
Give the container a near-black background class, such as bg-[oklch(0.13_0.04_265)], and white text. The neon colours are the default.
API Reference
LaserGrid
<div> data-slot="laser-grid"
accentColor?string
The colour of one beam in five, any CSS colour.
- Default
a neon magenta
beamColor?string
The beams' colour, any CSS colour. @default a neon cyan.
count?number
How many beams race at once. They're spread over the rows and columns of whatever box they're in, so all of them are always in view.
- Default
24
gridSpacing?number
The distance between grid lines, in pixels. @default 64.
lineColor?string
The grid lines' colour, any CSS colour.
- Default
the beams' colour at 25%
speed?number
How fast the beams race and the grid breathes, as a multiplier: 0.5 is calm, 2 is frantic.
- Default
1
render?ReactElement | ((props: object, state: object) => ReactElement)
Replace the host element or compose it with another component.
- Type
ReactElement | ((props: object, state: object) => ReactElement)
className?string
Merged with the part's classes.
--laser-grid-accent-colorstring
One beam in five (a neon magenta).
--laser-grid-beam-colorstring
The beams' colour (a neon cyan).
--laser-grid-line-colorstring
The grid lines' colour (the beams' at 25%).
--laser-grid-speedstring
How fast it moves, a multiplier (1).
Related
- Pro


Traces with slower signals
- Pro


Synthwave perspective grid


Grid Pattern
GridsThe grid without motion
- Pro


Neon Background
TechGlowing neon tubes


Beams Background
LightSoft light beams
- Pro


Cells blinking