BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/UI Components/github-forks

GitHub Forks

ui-components/github-forks
FreeBlock

Displays the fork count of a repository.

Install it

npx shadcn@latest add https://ui.raulcarini.dev/r/github-forks.json

Source

registry/github-stats/github-forks.tsxui.raulcarini.dev/r/github-forks.json
1import * as React from "react";
2
3import { Button } from "@/components/ui/button";
4import { Skeleton } from "@/components/ui/skeleton";
5import { GitForkIcon } from "lucide-react";
6
7export function GithubForks({ repo }: { repo: string }) {
8 return (
9 <Button
10 nativeButton={false}
11 size="sm"
12 variant="ghost"
13 className="h-8 shadow-none group"
14 render={
15 <a
16 href={`https://github.com/${repo}`}
17 target="_blank"
18 rel="noreferrer"
19 />
20 }
21 >
22 <GitForkIcon className="group-hover:scale-110 transition-transform duration-200 ease-out" />
23 <React.Suspense fallback={<Skeleton className="h-4 w-9" />}>
24 <ForksCount repo={repo} />
25 </React.Suspense>
26 </Button>
27 );
28}
29
30export async function ForksCount({ repo }: { repo: string }) {
31 const data = await fetch(`https://api.github.com/repos/${repo}`, {
32 next: { revalidate: 86400 }, // Cache for 1 day (86400 seconds)
33 });
34 const json: { forks_count: number } = await data.json();
35
36 return (
37 <p className="text-xs text-muted-foreground/70 group-hover:text-muted-foreground transition-colors duration-200 ease-out">
38 <span className="tabular-nums">
39 {json.forks_count >= 1000
40 ? `${(json.forks_count / 1000).toFixed(1)}k`
41 : json.forks_count.toLocaleString()}
42 </span>{" "}
43 forks
44 </p>
45 );
46}

What it pulls in

npm packages

  • lucide-react

Other registry items

  • button
  • skeleton

Files it writes

  • registry/github-stats/github-forks.tsx

Facts

Registry
UI Components
Type
registry:block
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

ui.raulcarini.dev R4ULtv/ui on GitHub Raw registry item This item as JSON

More from UI Components

All 25 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
GitHub Contributionsgithub-contributionsUI ComponentsBlocksFreeno deps
GitHub Contributions Advancedgithub-contributions-advancedUI ComponentsBlocksFreeno deps
GitHub Contributions Advanced Fetchergithub-contributions-advanced-fetcherUI ComponentsBlocksFreeno deps
GitHub Contributions Fetchergithub-contributions-fetcherUI ComponentsBlocksFreeno deps
GitHub Issuesgithub-issuesUI ComponentsBlocksFree1 dep
GitHub Pull Requestsgithub-prUI ComponentsBlocksFree1 dep
GitHub Starsgithub-starsUI ComponentsBlocksFree1 dep
GitHub Stars Progressgithub-stars-progressUI ComponentsBlocksFree1 dep
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex