Commit Graph
Topological git graph with rail lines showing branch forks, merges, and commit ancestry.
radix-ui
Loading...
Installation
$ shadcn add @jalco/commit-graphUsage
import { CommitGraph } from "@/components/commit-graph"<CommitGraph commits={commits} />Client component. Pass commits in topological order (newest first) with parents hashes — the graph computes fork and merge topology automatically. Click any commit row for a detail popover.
Examples
Linear history
A simple linear history with no branches or merges — single rail.
Loading...
Branching and merging
Commits with multiple parents create merge points. The graph draws curved rail lines between them.
Loading...
API Reference
CommitGraph
PropType
Commit
PropType
Notes
- Client component. Uses Radix Popover for commit detail views.
- Topological layout. The graph computes rail positions from parent hashes automatically.
- 8-color palette. Rails cycle through 8 colors, consistent for the same topology.
- Composable. Fetch from GitHub, GitLab, or any git API and map to the Commit interface.