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
GitHub star history
sonacode/sona-ui
2,487
+2,445 recorded
Installation
Basic usage
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:
Usage
API
| Property | Type | Default | Description |
|---|---|---|---|
data | GitHubStarHistoryDatum[] | required | Chronological observations displayed by the chart. |
repository | string | required | Repository name displayed above the chart, usually owner/repository. |
height | number | 280 | Height of the chart plot in pixels. |
color | string | "var(--primary)" | CSS color used by the line, area, and active marker. |
showChange | boolean | true | Shows the recorded change between the first and latest observations. |
animated | boolean | true | Reveals the chart from left to right when it first appears. |
ariaLabel | string | derived from repository | Accessible 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.