Loading preview
A dotted 3D Earth with glowing routes between cities; pulses travel each arc and ripple where they land.
A repeating dot grid background, with an optional fade toward the edges.
npx shadcn@latest add @venusui/dot-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/dot-pattern.tsxThe code behind the preview above.
dot-pattern-demo.tsx
import { DotPattern } from "@/components/ui/dot-pattern"
export default function DotPatternDemo() {
return (
<div className="relative flex h-56 w-full max-w-lg items-center justify-center overflow-hidden rounded-xl border bg-background">
<DotPattern fade />
<p className="relative text-lg font-medium">Dot pattern</p>
</div>
)
}
| Prop | Type | Default | Description |
|---|---|---|---|
| spacing | number | 16 | Distance between dots, in pixels. |
| radius | number | 1 | Dot radius, in pixels. |
| fade | boolean | false | Fade the dots out toward the edges with a radial mask. |
All <svg> props, including className and style.
cn helper at @/lib/utils. Works in Server Components.currentColor. Change the color with a text class, e.g. className="text-primary/20".relative and overflow-hidden, and put your content after the pattern with relative.aria-hidden and ignores the pointer.position: relative; otherwise the pattern fills the nearest positioned ancestor.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.