Installation
GitGraph installs as a shadcn registry component. Run the command below in any Next.js or Vite project that already has shadcn initialised (i.e. a components.json with the standard aliases components, lib, utils).
npx shadcn@latest add https://seanrobertwright.github.io/GitGraph/r/git-graph.jsonFiles copied
The installer writes the following into your project:
components/git-graph/git-graph.tsx— main componentcomponents/git-graph/git-graph-gutter.tsx— standalone DAG primitivecomponents/git-graph/git-graph.css— theming surface (CSS variables)components/git-graph/types.ts—Commit/Refshapescomponents/git-graph/lib/*.ts— layout, bezier, parser, validate, errors
Runtime dependency
The installer adds @tanstack/react-virtual to your dependencies (used for the windowed virtualization path). No other runtime peers beyond React 18+.
Importing the styles
Import the CSS once at the root of your app (e.g. in app/layout.tsx):
import "@/components/git-graph/git-graph.css";