Kinetic UI
Back to Introduction
Data Display

Activity Matrix

GitHub-style interactive heatmap with live ripple effects on click and micro-sparkline popovers.

Quick Actions
CLI Installation
npx kinetic-ui-cli@latest add activity-heatmap
Activity Matrix

Activity Matrix

Live events
Less
More

Installation

npx kinetic-ui-cli@latest add activity-heatmap

Mechanics

This component elevates the classic GitHub contribution graph using Framer Motion for interactive physics:

  1. Spotlight Hover: By tracking the hoveredCell coordinate (r, c), we can calculate the Euclidean distance to every other cell. Cells within a radius of 2.5 receive a slight scale boost, creating a localized magnifying-glass effect around the cursor.
  2. Click Ripples: On click, we log the rippleOrigin and the exact timestamp. We recalculate the distance from the click origin to all cells, mapping that distance to an animation delay. This creates a fluid shockwave traveling outward through the grid.

Usage Guide

1. Import the Component

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

import { ActivityHeatmap } from "@/components/creative/activity-heatmap";

2. Implementation Example

Render the component and customize its behavior by passing props:

import { ActivityHeatmap } from "@/components/creative/activity-heatmap";

export default function Example() {
  return (
    <div className="w-full flex items-center justify-center p-8">
      <ActivityHeatmap
        rows{10}
        cols{10}
      />
    </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.