AstroAnimate Docs — Installation, Components & API

GitHubShineButton NEW

A premium, CSS-only GitHub button featuring a sleek hover shine effect and integrated star count.

Preview/Playground

Created by
Creator
Prashanth
AstroAstro
---
import GitHubShineButton from "@astroanimate/core/GitHubShineButton";
---

<GitHubShineButton
  as="a"
  href="https://github.com/vipin/astroanimate"
  stars="1.2k"
>
  Star on GitHub
</GitHubShineButton>

Installation

bash
npm install @astroanimate/core

Usage

---
import GitHubShineButton from "@astroanimate/core/GitHubShineButton";
---

<GitHubShineButton />

Renders the GitHubShineButton component with AstroAnimate defaults.

Props

PropTypeDefaultDescription
as"button" | "a""button"HTML element to render
hrefstring-Target URL (required if as="a")
starsnumber | string0Number of stars to display
showStarsbooleantrueToggle visibility of the star section
type"button" | "submit" | "reset""button"Button type attribute (if as="button")
fontFamilystring"Inter, sans-serif"Custom font family override
classstring""Additional CSS classes

Use When

  • Linking to open-source repositories from project landing pages
  • Providing social proof by showcasing GitHub star metrics
  • Needing a high-quality, recognizable call-to-action for developers

Avoid When

  • Building primary application logic buttons (e.g., "Save Profile" or "Checkout")
  • Contexts where the dark GitHub branding clashes severely with a strict light-mode theme

Accessibility

  • Includes focus-visible outlines to ensure clear keyboard navigation paths
  • Uses aria-hidden="true" on inline SVGs to prevent redundant screen reader announcements
  • Respects prefers-reduced-motion: reduce by neutralizing the shine animation and instantly applying hover states

Performance

  • Zero Hydration: 100% CSS-driven with no JavaScript overhead
  • Hardware Accelerated: The sweeping shine effect utilizes the transform: translateX property on a pseudo-element, ensuring smooth 60fps rendering without layout recalculations

Credits