Carregando…
Carregando…
Carregando…Button showing a repository's live GitHub star count (client-side fetch), with fallback.
$ npx kikitocn add github-stars-button@/lib/utilsimport { GithubStarsButton } from "@/components/ui/cn/github-stars-button/GithubStarsButton";
export function GithubStarsButtonExample() {
return (
<GithubStarsButton>
Github Stars Button
</GithubStarsButton>
);
}| Prop | Tipo | Padrão | Descrição |
|---|---|---|---|
repo | string | 'damien-schneider/cuicui' | "owner/repo" consultado na API pública do GitHub |
href | string | `https://github.com/${repo}` | Destino do link |
children | React.ReactNode | — | Rótulo opcional ao lado do contador |
fallbackStars | number | — | Valor inicial/fallback se o fetch falhar; sem ele, erro mostra '—' |
className | string | — | Classes CSS extras |
Github Stars Button — busca a contagem real de stars na API pública do GitHub