| commits | Commit[] | — | Required. The full commit set to render. Topologically sorted internally. |
| head | string | — | Sha of HEAD. The matching row gets a HEAD indicator alongside its refs. |
| selectedSha | string | — | Controlled selection. When provided, GitGraph treats the component as controlled and won't update internal state. |
| defaultSelectedSha | string | — | Initial selection in uncontrolled mode. |
| onSelectChange | (sha: string | undefined) => void | — | Fires when the selection changes (controlled or uncontrolled). |
| onCommitClick | (commit: Commit) => void | — | Fires on row click. Independent of selection. |
| onCommitHover | (commit: Commit | null) => void | — | Fires on row mouseenter (with the commit) and mouseleave (with null). |
| filter | (commit: Commit) => boolean | — | Predicate that hides commits for which it returns false. The layout engine rewrites edges to skip filtered commits — if A's parent B is filtered out, A's edge points to B's nearest visible ancestor. Selection state survives a commit being filtered out: the row disappears but the detail drawer (if rendered) keeps the remembered commit. |
| renderDetail | (commit: Commit | undefined) => ReactNode | — | When provided, renders an off-canvas right-side drawer alongside the graph. The function receives the currently selected commit (or undefined if no selection) and returns the drawer's interior. |
| defaultDetailOpen | boolean | false | Initial open state of the detail drawer in uncontrolled mode. |
| detailOpen | boolean | — | Controlled open state of the detail drawer. When provided, GitGraph treats the drawer as controlled and won't update internal open state. |
| onDetailOpenChange | (open: boolean) => void | — | Fires when the drawer requests an open-state change (controlled or uncontrolled). In controlled mode, return this signal back into detailOpen to commit; ignore to decouple from the default click-to-open behavior. |
| showWorkingTreeRow | boolean | false | Prepend a synthetic working-tree row above HEAD. |
| laneWidth | number | 16 | Pixel width of one lane in the gutter. Must match the --graph-lane-width CSS variable if you override it. |
| rowHeight | number | 40 | Pixel height of each row. Must match --graph-row-height. |
| nodeRadius | number | 5 | Radius of commit nodes. |
| strokeWidth | number | 1.5 | Stroke width of edges. |
| className | string | — | Appended to the root <div>'s className. |
| scrollContainerRef | RefObject<HTMLElement | null> | — | If provided, GitGraph virtualizes against this scroll container instead of its own. Use for window-scroll layouts. |