npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gamzo/git-graph

v0.1.4

Published

Draw pretty git graphs with React

Readme

@gamzo/git-graph

Animated git graphs for React. Zero dependencies, TypeScript types, SSR-ready.

Live demo · Try your own graph

npm install @gamzo/git-graph

Requires react >= 18.

Quick start

import { Gitgraph } from "@gamzo/git-graph";

export function History() {
  return (
    <Gitgraph>
      {(gitgraph) => {
        const main = gitgraph.branch("main");
        main.commit("Initial commit");

        const feature = main.branch("feature");
        feature.commit("Make it work").commit("Make it fast");

        main.merge(feature).tag("v1.0.0");
      }}
    </Gitgraph>
  );
}

API

| Call | Does | |---|---| | gitgraph.branch(name) | New branch from HEAD | | branch.commit(subject \| options) | Add a commit | | branch.merge(other, subject?) | Merge commit ({ branch, fastForward: true } to fast-forward) | | branch.tag(name) | Tag the branch tip | | branch.checkout() / branch.delete() | Move HEAD / delete the branch | | gitgraph.import(json) | Draw a real repo from git2json output |

Commit options: subject, body, author, hash, tag, dotText, style, onClick, renderDot, renderMessage, renderTooltip.

Options

<Gitgraph
  options={{
    orientation: "horizontal", // or "vertical-reverse", "horizontal-reverse"
    mode: "compact",           // fewer rows
    template: "blackarrow",    // "metro" (default), "blackarrow", or a custom one
    author: "Ada <[email protected]>",
  }}
>
  {(gitgraph) => { /* … */ }}
</Gitgraph>

Custom template

import { templateExtend } from "@gamzo/git-graph";

const template = templateExtend("metro", {
  colors: ["#7c3aed", "#0ea5e9", "#f59e0b"],
  branch: { lineWidth: 4, spacing: 40, mergeStyle: "straight" },
  commit: {
    spacing: 48,
    dot: { size: 8 },
    message: { displayAuthor: false, displayHash: false },
  },
});

<Gitgraph options={{ template }}>{/* … */}</Gitgraph>;

Custom rendering

Replace any piece with your own SVG. Clicks and hovers keep working.

main.commit({
  subject: "Ship it",
  renderDot: (commit) => (
    <rect width={commit.style.dot.size * 2} height={commit.style.dot.size * 2} rx={3} fill={commit.style.dot.color} />
  ),
  onClick: (commit) => console.log(commit.hash),
});

Also: renderMessage, renderTooltip (commits), renderLabel (branches), render (tags), renderEdge (lines, on <Gitgraph>).

Live graphs

To add commits after the first render, keep the graph with useGitgraph:

import { Gitgraph, useGitgraph } from "@gamzo/git-graph";

export function Live() {
  const graph = useGitgraph({}, (gitgraph) => gitgraph.branch("main").commit("Init"));

  return (
    <>
      <button onClick={() => graph.getUserApi().commit("One more")}>Commit</button>
      <Gitgraph graph={graph} animation={{ impact: true }} />
    </>
  );
}

Animation

| Prop | Effect | |---|---| | (default) | Lines draw in order, commits fade in | | animation={false} | No animation | | animation={{ duration, maxTotal }} | ms per line, cap for the first draw | | animation={{ impact: true }} | Commits added later land with a charge, a slam and a jolt |

Reduced motion is respected. Lines are path.gg-edge and commits g.gg-commit; the built-in CSS has zero specificity, so your CSS wins.

Good to know

  • Dark mode: set --gg-tooltip-bg and --gg-tooltip-color; everything else comes from the template.
  • Keyboard: commits with onClick are focusable buttons (Enter / Space).
  • Strict CSP: pass <Gitgraph nonce={nonce}>.
  • TypeScript: Commit, TemplateOptions, TagStyle, EdgeProps and more are exported.

License

MIT. Based on GitGraph.js by Nicolas Carlo and Fabien Bernard.