shadcn.io is not affiliated with official shadcn/ui
Perspective Grid Hero Block for React
A showcase hero for a browser racing engine: one panel between solid page rails where a perspective floor grid rolls toward you under a beta pill, a headline, a Shine Button and an outline button.
Installation
Overview
A centred showcase hero over a retro-futuristic floor grid, for React with Base UI. One panel fills the page column between its solid rails, flush with the top rule: a beta pill, a large headline and one supporting line sit on the sky, a Shine Button and an outline button under them, and the floor runs on below to the foot of the section, its lines rolling slowly toward you and melting into haze at the horizon. A small race readout (lap, time, speed) floats on the floor as a piece of game UI. It's built from Retro Grid, Announcement, Badge, Status, Shine Button, Button and Guides, with CSS transitions for the entrance and your theme's tokens for every colour: the grid is drawn in the foreground colour, so the block is light on a light theme and dark on a dark one. For game engines and studios, graphics tools, developer platforms and creative products that want a restrained synthwave mood.
FAQ
How do I change the grid?
The panel is a Retro Grid. cellSize sets the side of a grid cell (56px here), angle how far the floor tilts away from you (70°: higher lies flatter and puts the horizon lower), and speed how fast the lines roll (0.4 of the default). lineColor and glowColor are any CSS colours: here your theme's foreground mixed down to 30% and 6%, so the grid stays quiet in both themes; pass var(--primary) as the glow for a coloured horizon. How much floor shows below the buttons is the panel's bottom padding (pb-64 on a phone, md:pb-[26rem] on a desktop).
Does the moving grid slow the page down?
No. Only the lines move, by a CSS translate that loops by exactly one cell, so the loop never jumps, nothing repaints and no script runs to animate it; the block itself has no state or effects. Visitors who ask for reduced motion get a floor that stands still, and the text fades up once on load, which also stops.
What does the amber dot in the pill mean?
It marks the release stage, beta, in your theme's warning colour, and the word Beta beside it says the same thing, so the colour is never the only cue. The dot is a Status, hidden from assistive tech. For a general release, switch it to variant="success" and change the word.
How do I point the buttons at my pages?
Start your first lap and Browse sample tracks are links (href="#"); point them at your sign-up and your gallery. Start your first lap is a Shine Button, the one main action: a band of light sweeps across it once when the pointer arrives or it takes focus (with reduced motion it fades in where it stands).
Each button renders the link it's given with render, with nativeButton={false}.
Is it accessible to screen reader and keyboard users?
The grid and the race readout are decoration: hidden from assistive tech and never focusable. The headline is the page's h1, and every text keeps WCAG AA contrast where it crosses the grid lines, since the floor only starts below the buttons. The pill and both buttons are links with a visible focus ring, and with reduced motion nothing rolls, fades or rises.
How does it fit on a phone?
The headline steps down from text-6xl to text-4xl, the side padding shrinks, and the buttons stack when the row is too narrow, with the first one inside the first screen. The floor's perspective is sized to the panel, so the horizon sits at the same height at any width, and the race readout stays centred at the foot of the floor.
Related
- Pro
Concentric Rings Hero
BackdropsA compact, centred hero for a design tool on solid rails: concentric rings breathe behind a headline, a Shine Button and an outline button, over a ruled band of three stats.
- Pro
Starfield Backdrop Hero
BackdropsA compact centred hero flying slowly through a field of stars on a framed stage: a live launch pill, a headline, a Shine Button to the waitlist, a quiet second link and the waitlist's size.
- Pro
Glass Card Hero
BackdropsA compact card-in-card hero on solid rails: a frosted glass panel with a ring over a drifting mesh of your accent's tones, in a hairline frame with + marks, with a Shine Button and an outline button.
- Pro
Metric Tiles Hero
Stats and live dataA compact left-aligned hero for an edge network with a live status pill, a Shine Button and an outline button at the end of the row, and four metric tiles below, each a ruled cell with a trend.
- Pro
Centered Diagonal Line Grid Hero
BackdropsA large centered hero over a diagonal line grid that fades toward its edges, with an announcement link, a Shine Button and three checked features as ruled rows between the rails.
- Pro
Single-CTA Ultra-Minimal Statement Hero
Type and motionAn ultra-minimal statement hero: a two-word headline at display size in one cell, and in a cell across a solid divider the one Shine Button and two lines of reassurance.