Browse components
Squares Grid
An endlessly scrolling grid; the square under the cursor fills in.
Squares Grid
Installation
npx shadcn@latest add @glint-ui/squares-gridFirst time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glint-ui-seven.vercel.app/r/squares-grid.json
Usage
import { SquaresGrid } from "@/components/ui/squares-grid";
<div className="relative h-96">
<SquaresGrid direction="diagonal" />
</div>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| squareSize | number | 40 | Px per square. |
| speed | number | 0.5 | Px per frame; 0 holds still. |
| direction | "diagonal" | "up" | "down" | "left" | "right" | "diagonal" | Scroll direction. |
| borderColor | string | "#27272a" | Grid line color. |
| hoverFill | string | "#1f2a12" | Fill of the hovered square. |
| className | string | — | Extra classes for the root element. |