Generate SDKs from your OpenAPI spec on every merge and publish them to npm, PyPI and Maven without leaving CI.
Works with
Vercel
GitHub
Cloudflare
Astro
Installation
Install from
pnpm dlx @glinui/cli@latest add grid-pattern
Credits. Adapted from Magic UI (MIT, (c) Magic UI). Merged grid, interactive and stripes variants, token colors, collision free SVG ids, CSS only hover cells and edge fade masks. Attribution details.
Prefer the package?
Usage
Use the fade prop (or your own mask) so the pattern dissolves toward the edges. Interactive cells need pointer events: content layered above the pattern will intercept them, and the cell count is capped at 1600.
Highlighted squares pulse only at motion level full.
<ddclassName="text-xs text-[var(--tone-success-text)]">{delta} vs yesterday</dd>
</div>
))}
</dl>
</section>
)
}
Interactive
Hover cells to light them up. CSS only.
<GridPatterninteractivewidth={32}height={32}/>
Accessibility
Decorative: aria-hidden, not focusable, pointer-events none (interactive cells opt back in).
Hover highlighting is a visual flourish only and has no keyboard equivalent by design.
Keep line contrast low behind text.
ARIA Attributes
`aria-hidden="true"` and `focusable="false"` on the svg
Reduced Motion
Highlighted squares pulse at motion level full. With reduced motion or level none or subtle the squares are static, and hover cell transitions are removed.
Affected properties
opacityfill
API Reference
Prop
Type
Required
Default
Description
variant
"grid" | "stripes"
No
grid
Square grid lines or diagonal stripes.
fade
"none" | "radial" | "top" | "bottom"
No
none
Edge fade built with CSS masks.
width / height
number
-
40
Cell size in px.
x / y
number
-
-1
Pattern offset.
strokeDasharray
string
No
0
Dashed lines, for example "4 2".
squares
GridPatternSquare[]
No
-
Highlighted cells as [column, row].
squareColor
string
No
var(--color-accent)
Highlight and hover color.
interactive
boolean
No
false
Cells light up on hover.
height
number
No
40
Cell height in px.
width
number
No
40
Cell width in px.
x
number
No
-1
Auto-generated from TypeScript source.
y
number
No
-1
Auto-generated from TypeScript source.
Source
Import directly from the package or browse the source on GitHub. Click any file to view it.
Auto-extracted from TypeScript source in packages/ui/src/components/grid-pattern.tsx. This section is in beta and may lag behind hand-curated docs. Regenerate with pnpm --filter @glinui/docs api:generate.