Back to Backgrounds

Kinetic Grid

An interactive grid background whose lines and nodes ripple outward wherever you click.

Updated Added Changelog

motion

Preview

Move the cursor. Click for ripples.

Installation

pnpm dlx shadcn@latest add @satoriui/kinetic-grid

Adds components/satori-ui/kinetic-grid.tsx to your project and installs its dependencies.

Usage

app/page.tsx
import KineticGrid from "@/components/satori-ui/kinetic-grid";
export default function Example() {
return (
<KineticGrid className="h-[480px] bg-background text-foreground">
<div className="flex h-full items-center justify-center">Your content</div>
</KineticGrid>
);
}

Examples

Following your theme

The grid draws in the current text colour and glows in accentColor, so the grid matches the page in light and dark mode. Switch the theme to see it change.

Built for the way you work

The grid draws in your text colour and glows in your primary, in light and dark.

Light and monochrome

A white field with black lines and a black glow, for a page with no accent colour.

Black ink on white paper

Props

children

Content shown over the grid. It fills the grid, so lay it out yourself, for example with flex centring.

TypeReactNode
className

Classes for the wrapper. The grid fills it, so give it a height. Its background shows through the grid.

Typestring
color

Colour of the lines and dots, as any CSS colour, including a theme variable. They are drawn faintly, so pick the colour you would use for text on this background.

TypestringDefault"currentColor"
accentColor

Colour of the glow under the pointer and of the click ripples, as any CSS colour.

TypestringDefault"var(--primary)"
reducedMotion

"user" follows a surrounding MotionConfig, then the visitor's reduce-motion setting. "always" and "never" force the calm or the full version.

Type"user""always""never"Default"user"

Also takes every <div> prop except color.

Reduced motion

Kinetic Grid follows the visitor's “reduce motion” device setting on its own: movement, blur and looping effects stop, and fades stay. Use the Reduced motion button on the preview to see that version. To decide yourself, set the reducedMotion prop on one instance, or wrap a whole section or app in Motion's MotionConfig.

app/page.tsx
// Follows the visitor's device setting (the default, "user")
<KineticGrid>…</KineticGrid>
// Always the calm version, or always full motion
<KineticGrid reducedMotion="always">…</KineticGrid>
<KineticGrid reducedMotion="never">…</KineticGrid>
// Or for everything inside, with Motion's MotionConfig
import { MotionConfig } from "motion/react";
<MotionConfig reducedMotion="always">
<KineticGrid>…</KineticGrid>
</MotionConfig>