Grid & Dot Background

A quiet line, dot or cross pattern behind a section, fading out toward the edges.

Category
Creative
Access
Free with an account
Source
109 lines · one file
States
5 drawn

The decision inside it

The fade is part of the component

A grid that stops at a hard edge looks like a mistake, so every pattern comes with a fade and you pick where it falls.

When to use it

Use Grid & Dot Background behind a hero or feature section for quiet texture: lines, dots or crosses that fade out at the edges. For colour and movement, use Aurora Background.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Liro's Grid & Dot Background for this.
Install it: npx shadcn@latest add @liro/grid-background
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/grid-background.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Free components install through the @liro registry with your CLI token: see the Namespaced tab.

Usage

components/hero-section.tsx
import { GridBackground } from "@/components/ui/grid-background";

export function HeroSection() {
  return (
    <GridBackground pattern="dots" fade="radial" className="rounded-3xl py-24 text-center">
      <h1 className="text-4xl font-semibold">Contracts signed before the meeting ends.</h1>
    </GridBackground>
  );
}

API reference

“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

TypeNotes
pattern"grid" | "dots" | "cross" NoLines, dots or small crosses. Default "grid".
sizenumber NoOne cell, in pixels. Default 32.
fade"none" | "radial" | "bottom" | "edges" NoWhere it fades out. Default "radial".
driftboolean NoSlow movement, one cell every 6 seconds. Default false.
colorstring NoThe pattern's colour. Default the theme's border colour.
childrenReact.ReactNode No–

Dependencies

npm packages

clsxtailwind-merge

Liro foundations, installed alongside it

liro-theme

States

All of them are drawn by the component. None is left for you to design.

  • Grid
  • Dots
  • Crosses
  • Drifting
  • Reduced motion

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances