Lazy-ui
Lazy-ui
registry components
DocsComponentsBlocksChangelog
GitHub0Install
Navigation11 groups
Get StartedDocs
  • Introduction
  • Installation
  • Changelog
  • All Components
Background13 items
  • Wave CipherNew
  • Horizon CipherNew
  • Orbit CipherNew
  • Orbit BloomNew
  • Orbit MeshNew
  • Aurora MeshNew
  • Chroma FlowNew
  • Prism DriftNew
  • Shadow MeshNew
  • Slime BackgroundNew
  • NeumorphismNew
  • Ripple SurfaceNew
  • Liquid ChromeNew
Text Animate7 items
  • Shiny Text
  • Text WarpNew
  • Text RiseNew
  • Text SpinNew
  • Text ScrambleNew
  • Spinning TextNew
  • Text FlipNew
Animate6 items
  • Counter
  • Liquid RevealNew
  • Liquid TransitionNew
  • Matrix GridNew
  • Particle HaloNew
  • Bling TransitionNew
Effects2 items
  • Reveal Animate
  • Circle CipherNew
Forms2 items
  • Switch
  • Checkbox
Buttons3 items
  • Copy Button
  • GitHub Stars Button
  • Glass ButtonNew
Feedback1 item
  • Progress
Navigation1 item
  • Animated Tabs
Overlay1 item
  • Animate Tooltip
Device Mocks1 item
  • iPhoneNew

GitHub Stars Button

A GitHub repo button with automatic star fetching and animated Counter digits.

github-stars-button
GitHub0
0px

Customize

Edit props; preview updates instantly.

Customize
Variant
Format
Counter
Hover
Hover duration
300ms
RepositoryLive data via /api/github-stars
github.com//
Try

Props

Props accepted by GithubStarsButton.

PropTypeDefaultDescription
usernamestring—GitHub username or organization.
repostring—GitHub repository name.
labelstring"GitHub"Button label.
valuenumber—Controlled star count. When provided, automatic fetching is skipped.
initialValuenumber0Fallback star count shown before the API request resolves.
fetchStarsbooleantrue when value is undefinedFetch the repository star count automatically when the component is uncontrolled.
apiEndpointstring—Optional proxy endpoint. It receives `owner` and `repo` query params and should return `{ stars }`.
showCountbooleantrueShow the animated star count beside the label.
counterEffect"simple" | "wheel" | "smooth" | "fade" | "3d""3d"Counter animation effect used for the star count.
variant"default" | "star" | "ghost" | "solid" | "silver""default"Visual palette. `silver` paints the brand silver gradient with dark text; `star` tints with yellow; `solid` is a deep black surface; `ghost` is borderless until hover.
displayFormat"full" | "compact" | "plus""compact"How the star count renders. `full` → 14,021. `compact` → 14k. `plus` → 14000+.
hoverMode"none" | "label" | "full""none"On hover: `label` swaps just the label text, `full` cross-fades the entire inner content for a call-to-action.
hoverLabelstring"Star this"Label shown on hover when `hoverMode="label"`.
hoverContentReactNode"Star on GitHub"Inner content shown on hover when `hoverMode="full"`.
hoverDurationnumber300Duration in milliseconds of the hover content swap (`label` / `full` modes). Higher = slower, more deliberate feel.
hrefstringcomputed GitHub repo URLOverride the generated repository URL.
classNamestring—Extra class names merged onto the anchor button.

Installation

Choose CLI for the one-line shadcn install, or copy the file manually.

npx shadcn@latest add https://2lazyui.com/r/github-stars-button.json

Usage

Import the component and drop it into a render.

demo.tsx11 lines
import { GithubStarsButton } from "@/components/lazy-ui/github-stars-button";

export function Demo() {
  return (
    <GithubStarsButton
      username="zivhdinfo"
      repo="lazy-ui"
      initialValue={12848}
    />
  );
}
Registryv0.1
Animated TabsNavigationCopy ButtonButtonsGitHub Stars ButtonButtonsReveal AnimateEffectsCounterAnimateShiny TextText AnimateText WarpText AnimateText RiseText AnimateText SpinText AnimateText ScrambleText AnimateSpinning TextText AnimateText FlipText AnimateProgressFeedbackSwitchFormsGlass ButtonButtonsCheckboxFormsiPhoneDevice MocksCircle CipherEffectsLiquid RevealAnimateLiquid TransitionAnimateWave CipherBackgroundHorizon CipherBackgroundOrbit CipherBackgroundOrbit BloomBackgroundOrbit MeshBackgroundMatrix GridAnimateParticle HaloAnimateAurora MeshBackgroundChroma FlowBackgroundPrism DriftBackgroundShadow MeshBackgroundSlime BackgroundBackgroundNeumorphismBackgroundRipple SurfaceBackgroundLiquid ChromeBackgroundBling TransitionAnimateAnimate TooltipOverlayPricing · ClassicBlocks · PricingPricing · BentoBlocks · PricingPricing · EditorialBlocks · PricingPricing · MatrixBlocks · PricingPricing · UsageBlocks · Pricing
Browse all 42 components
Up nextRoadmap
DialogPlanned
TabsPlanned
TooltipPlanned
CommandPlanned
Help the project
Star on GitHubSuggest a componentRead the DESIGN.md