Skip to content
← Components

Dot Grid

Dot Grid adds a distinctive visual surface to your composition.

Open ↗

Make it yours.

Install the editable source and its dependencies into your React + Tailwind project.

Scroll horizontally for long lines
pnpm dlx shadcn@4.0.8 add http://localhost:3000/r/dot-grid.json

Use it

Scroll horizontally for long lines
"use client";
import { DotGrid } from "@/components/jez-ui/ui/dot-grid";

export default function Example() {
  return (
    <>
      <DotGrid className="min-h-[360px]">
        <div className="flex min-h-64 flex-col justify-between">
          <h3 className="max-w-md font-display text-5xl font-medium leading-[1.03] tracking-tight md:text-6xl">
            A starting point.
          </h3>
          <p className="mt-8 text-sm">Space to connect your ideas.</p>
        </div>
      </DotGrid>
    </>
  );
}

Props & types

Scroll horizontally for long lines
Omit<
  React.ComponentProps<"div">,
  keyof {
    children?: React.ReactNode;
    className?: string;
  }
> & {
  children?: React.ReactNode;
  className?: string;
}

Source

View 2 source files

registry/ui/dot-grid.tsx

Scroll horizontally for long lines
"use client";
import * as React from "react";
import { cn } from "./utils";
export function DotGrid({
  children,
  className,
  ...rootProps
}: Omit<
  React.ComponentProps<"div">,
  keyof {
    children?: React.ReactNode;
    className?: string;
  }
> & {
  children?: React.ReactNode;
  className?: string;
}) {
  return (
    <div
      {...rootProps}
      className={cn("min-h-60 rounded-xl bg-background p-8", className)}
      style={{
        backgroundImage: "radial-gradient(var(--border) 1px,transparent 1px)",
        backgroundSize: "18px 18px",
        ...rootProps.style,
      }}
    >
      {children}
    </div>
  );
}

registry/ui/utils.ts

Scroll horizontally for long lines
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";
export function cn(...values: ClassValue[]) {
  return twMerge(clsx(values));
}

Dependencies

clsx@2.1.1 · tailwind-merge@3.5.0

Accessibility & behaviour

Respect reduced-motion preferences. Decorative effects must not carry essential information. WebGL scenes include a static fallback and only render while visible.

Read the accessibility and performance guide →