Kinetic UI
Back to Introduction
Hero Components

Gravity Grid Hero

A highly interactive canvas-based hero section where background grid elements react dynamically to the user's cursor with spring physics.

Quick Actions
CLI Installation
npx kinetic-ui-cli@latest add gravity-grid-hero

The GravityGridHero renders a highly performant HTML5 <canvas> background underneath your hero content. The grid of dots (or connected lines) uses raw mathematics and spring physics to continuously calculate distance from the mouse pointer, repelling elements outwards before smoothly springing them back to their origin.

Live Preview

Gravity Grid Hero
Interactive Physics

Gravity Grid

A raw canvas implementation running at 60fps. Move your cursor to repel the points and watch the spring physics snap them back into place.

Usage Guide

1. Import the Component

Import the component into your React or Next.js page:

import { GravityGridHero } from "@/components/creative/gravity-grid-hero";

2. Implementation Example

Render the component and customize its behavior by passing props:

import { GravityGridHero } from "@/components/creative/gravity-grid-hero";

export default function Example() {
  return (
    <div className="w-full flex items-center justify-center p-8">
      <GravityGridHero
        variant{/* value */}
        badgeText="example"
        title="example"
      />
    </div>
  );
}
Performance Notes
  • Uses CSS hardware acceleration via GPU transform-binds.
  • Damped interpolation minimizes paint-redraw flashes.
  • Tree-shakable import: only compiles elements requested.
Accessibility Notes
  • Full keyboard focus-ring navigation support (`Tab`/`Shift+Tab`).
  • ARIA roles mapped correctly for assistive screen readers.
  • Respects `prefers-reduced-motion` system toggles.