121 Pro components and page blocks

Get Pro

Updated

Open Source

New

Preview

Customize

Stars24817
Forks1342
Contributors186
Full
Faces8
Feed rows3
Interval3.0s
Star colour

Installation

npx shadcn@latest add https://uibrik.com/r/open-source.json
Adds the files to components/uibrik/open-source and installs @tabler/icons-react, motion and react-use-measure. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/open-source.

Usage

import { OpenSource } from "@/components/uibrik/open-source/open-source";​const activity = [  { type: "release", title: "Released v2.4.0", meta: "v2.4.0" },  { type: "merge", title: "Faster theme switching", meta: "#412" },  // …6 more];​const starHistory = [120, 140, 132, 168, 190, 176, 214, 260, 248, 302, 344, 410];​const languages = [  { name: "TypeScript", share: 78.4, color: "#3178c6" },  { name: "CSS", share: 14.2, color: "#663399" },  // …1 more];​<OpenSource  repo="acme/ui"  version="v2.4.0"  stars={24817}  forks={1342}  contributorCount={186}  format="full"  maxAvatars={8}  showLanguages  showActivity  feedRows={3}  interval={3}  starLabel="Star on GitHub"  starColor="#f5b301"  href="#"  description=""  activity={activity}  starHistory={starHistory}  languages={languages}  locale="en-US"  defaultStarred={false}  onStarredChange={(starred) => {}}  // contributors={[{ name: "…" }]}  // starred={false}/>

Where to use Open Source

  • Repo landing pages

    Stars, forks and contributors rolling up on view give a project's homepage real numbers.

  • GitHub stats on a site

    A language bar, sparkline and commit feed summarise a repo without leaving the page.

  • Developer social proof

    Contributor faces fanning open show a healthy community behind the tool.

    Pairs with Avatar Stack

Props

OpenSource
repo
Type string
"acme/ui"
Repository as owner/name; the name is set in bold.
version
Type string
"v2.4.0"
Latest release tag. Empty hides it.
stars
Type number
24817
Star count.
forks
Type number
1342
Fork count.
contributorCount
Type number
186
Total contributors; the faces beyond the row are counted in a +N chip.
format
Type "full" | "compact"
"full"
24,817 or 24.8k.
maxAvatars
Type number
8
Most contributor faces in the row.
showLanguages
Type boolean
true
A bar of the repository's languages in their usual colours.
showActivity
Type boolean
true
Recent commits, merges and releases, stepping one entry at a time.
feedRows
Type number
3
Entries in view at once.
interval
Type number
3
Time between feed steps.
starLabel
Type string
"Star on GitHub"
Label of the star button. Empty hides it.
starColor
Type string
"#f5b301"
Colour of the star once starred, and of the sparkline.
href
Type string
"#"
Link for the repository name.
description
Type string
""
One line under the name. Empty hides it.
contributors
Type { name: string; src?: string }[]
12 people
Faces in order. Initials stand in when there is no photo.
activity
Type { type: "commit" | "merge" | "release"; title: string; meta?: string }[]
8 entries
Recent activity, newest first. meta is the short SHA, pull request number or tag on the right.
starHistory
Type number[]
12 points
Stars per period, oldest first, drawn as a sparkline under the counts. Empty hides it.
languages
Type { name: string; share: number; color: string }[]
TypeScript, CSS, MDX
Languages and their share in percent, with GitHub's colours by default.
locale
Type string
"en-US"
Locale for number formatting.
starred / defaultStarred
Type boolean
false
Whether the viewer has starred, controlled or uncontrolled. Starring adds one to the count.
onStarredChange
Type (starred: boolean) => void
–
Called when the star button is pressed. Wire it to your own GitHub OAuth flow or open the repo.
className
Type string
–
Classes for the card.