GitHub Star History

Use GitHub Star History to present cumulative repository growth as an interactive smooth area chart. Supply normalized observations from your own GitHub request, cache, or static data source.

Preview

Reduce motion:Off
Tune:Off
Inspect

GitHub star history

sonacode/sona-ui

2,487

+2,445 recorded

Installation

Basic usage

TypeScript
repository-stars.tsx

GitHub's star-history endpoint returns weekly objects with week, total, and days. Convert week from Unix seconds before passing the records to the chart:

TypeScript
github-star-history-data.ts

Usage

API

PropertyTypeDefaultDescription
dataGitHubStarHistoryDatum[]requiredChronological observations displayed by the chart.
repositorystringrequiredRepository name displayed above the chart, usually owner/repository.
heightnumber280Height of the chart plot in pixels.
colorstring"var(--primary)"CSS color used by the line, area, and active marker.
showChangebooleantrueShows the recorded change between the first and latest observations.
animatedbooleantrueReveals the chart from left to right when it first appears.
ariaLabelstringderived from repositoryAccessible name for the interactive chart.

Accessibility

The chart is keyboard explorable. Focus it, then use the Left and Right Arrow keys to move through observations. Home and End jump to the first and latest values. The current date and star total are exposed to assistive technology.

Styling

Use color for the series color and className to adapt the containing surface. The component uses semantic theme tokens for its background, border, labels, and tooltip.

Contact

Found a bug or need help using this component? Open an issue on GitHub.

License & Usage

Sona UI is available under the MIT license. You may use, modify, and distribute this component in personal and commercial projects.

Was this page helpful?

Your response helps us improve component docs.