A lightweight, interactive repository tree viewer and dynamic SVG generator for GitHub repositories.
Live instance: github-tree-widget.vercel.app
- Automatic Tree Generation: Fetches repository structure in real time using the GitHub REST API.
- Dynamic SVG Card: Generates an embeddable SVG image (
/api/svg) compatible with GitHubREADME.mdfiles. - Interactive Explorer: Web viewer with drag-to-pan, bounded zoom levels, and direct links to folders and files.
- Zero-Database Customization: Supports optional per-repository descriptions and ignored paths via a
.repomap.jsonfile.
Add the following Markdown snippet to your README.md, replacing <username> and <repository> with your GitHub details:
[](https://github-tree-widget.vercel.app/?user=<username>&repo=<repository>)Optional query parameter: &branch=<branch_name> (defaults to main).
To embed the interactive viewer with zoom and pan controls into an HTML page:
<iframe
src="https://github-tree-widget.vercel.app/?user=<username>&repo=<repository>"
width="100%"
height="460"
frameborder="0"
title="Repository Map">
</iframe>To hide specific files or add inline descriptions to nodes, create a .repomap.json file in the root of your target repository:
{
"ignore": [".repomap.json", ".gitkeep", ".gitignore", "docs"],
"items": {
"src": {
"description": "Source code"
},
"README.md": {
"description": "Project documentation"
}
}
}Because only repository maintainers can push changes to .repomap.json, descriptions remain read-only for visitors.
- Fork or clone this repository.
- Import the project into Vercel and deploy.
- (Optional) Add a read-only
GITHUB_TOKENenvironment variable in your Vercel project settings to increase the GitHub API rate limit from 60 to 5,000 requests per hour.