Skip to content

    Browse components

    Squares Grid

    An endlessly scrolling grid; the square under the cursor fills in.

    Squares Grid

    Open
    Customize
    diagonal
    up
    down
    left
    right

    Installation

    npx shadcn@latest add @glint-ui/squares-grid

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/squares-grid.json

    Usage

    import { SquaresGrid } from "@/components/ui/squares-grid";
    
    <div className="relative h-96">
      <SquaresGrid direction="diagonal" />
    </div>

    Props

    PropTypeDefaultDescription
    squareSizenumber40Px per square.
    speednumber0.5Px per frame; 0 holds still.
    direction"diagonal" | "up" | "down" | "left" | "right""diagonal"Scroll direction.
    borderColorstring"#27272a"Grid line color.
    hoverFillstring"#1f2a12"Fill of the hovered square.
    classNamestring—Extra classes for the root element.