How to add stats cards and animations to a GitHub README
Updated 25 November 2026
Short answer
Stats cards and animations in a GitHub README are SVG images loaded from a URL. You add them with a normal Markdown or HTML image tag; the server draws the card from your live GitHub data, and any animation is CSS inside the SVG, which GitHub renders.Step by step
- Pick the card. Choose a card type: stats, top languages, activity or a header banner.
- Copy the image URL. The URL includes your username and the theme, for example /api/card?type=stats&username=you.
- Add it to README.md. Use  or <img src="url" alt="..." width="..."> to control size.
- Support dark mode. Wrap light and dark versions in a picture element with a prefers-color-scheme source.
Light and dark versions
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://prettygit.com/api/card?type=stats&username=you&theme=folio-dark">
<img alt="GitHub stats" src="https://prettygit.com/api/card?type=stats&username=you&theme=folio">
</picture>Why animations work
GitHub strips scripts from READMEs but keeps images. An SVG can carry its own CSS animation, so motion keeps playing inside the image. GIFs work too but are larger and blurrier.
PrettyGit skins use animated SVG cards, and its design studio exports your own animated pages as SVG files into .github/readme/ in your repository, so they do not depend on any outside server.
FAQ
- Why are my stats out of date?
- GitHub caches README images through its camo proxy. Updates usually show within a few hours.
- Can I self-host the images?
- Yes. Export the SVG files and commit them to the repository, then link them with relative paths.