Loading preview
A dotted 3D Earth with glowing routes between cities; pulses travel each arc and ripple where they land.
Grid lines as a background, with optional highlighted cells and an edge fade.
npx shadcn@latest add @venusui/grid-patternRun this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.
Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.
@/components/ui/grid-pattern.tsxThe code behind the preview above.
grid-pattern-demo.tsx
import { GridPattern } from "@/components/ui/grid-pattern"
export default function GridPatternDemo() {
return (
<div className="relative flex h-56 w-full max-w-lg items-center justify-center overflow-hidden rounded-xl border bg-background">
<GridPattern fade highlight={[[3, 1], [5, 2], [8, 1], [10, 3]]} />
<p className="relative text-lg font-medium">Grid pattern</p>
</div>
)
}
| Prop | Type | Default | Description |
|---|---|---|---|
| size | number | 32 | Cell size, in pixels. |
| highlight | [number, number][] | [] | Cells to fill, as [column, row] pairs from the top-left. |
| dashed | string | — | SVG dash pattern for the lines, e.g. "4 2". |
| fade | boolean | false | Fade the grid out from the top center. |
All <svg> props, including className and style.
cn helper at @/lib/utils. Works in Server Components.currentColor; set it with a text class such as text-border.highlight={[[4, 2], [6, 3]]}.aria-hidden and ignores the pointer.Unknown registry "@venusui"npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.No components.json foundnpx shadcn@latest init in your project first.A dotted 3D Earth with glowing routes between cities; pulses travel each arc and ripple where they land.
Soft, blurred color fields that drift slowly behind content.
Curved lines across a section with light traveling along them.