Skip to content
Browse components

RepoActivity

A repository's commits for the period, split by branch in one bar. Point at a branch to read it alone.

Repository

relay/web · main
218commits this week
5branches
3open
12merged

Installation

Run this in a project that has a components.json. It adds one file, components/tenor-ui/repo-activity.tsx, and no packages.

pnpm dlx shadcn@latest add https://tenor.design/r/repo-activity.json

No components.json? Fetch the file. It works in any React project.

curl --create-dirs -o src/components/tenor-ui/repo-activity.tsx https://tenor.design/r/repo-activity.tsx

Usage

Every prop is optional. With none, it renders the content you see above.

<RepoActivity />
import { RepoActivity } from "@/components/tenor-ui/repo-activity"; export function WeeklyActivity({ onSync }: { onSync: () => void }) { return ( <RepoActivity repository="acme/storefront · main" branches={[ { name: "main", commits: 142 }, { name: "feat/checkout", commits: 68 }, { name: "fix/cart-totals", commits: 23, color: "#ff5c5c" }, ]} stats={[ { icon: "branch", count: 3, label: "branches" }, { icon: "pull", count: 4, label: "open" }, { icon: "merge", count: 19, label: "merged" }, ]} period="this week" onSync={onSync} /> ); }

Props

PropTypeDefaultWhat it does
theme"dark" | "light""dark"Dark or light palette.
headingstring"Repository"Heading of the card.
repositorystring"relay/web · main"Line under the heading, beside the branch icon.
branchesreadonly RepoActivityBranch[]repoActivityBranchesBranches in bar order. Each one is a segment and a chip.
statsreadonly RepoActivityStat[]repoActivityStatsCounts shown above the bar.
totalnumberNoneHeadline figure. Defaults to the sum of the branches' commits.
unitstring"commits"What the headline and the segments count.
periodstring"this week"The period the headline covers.
syncLabelstring"Sync"Text of the button.
onSync() => voidNoneCalled when the button is pressed.

It also takes every attribute of its root element, such as className and style.

Theming

Set any of these CSS variables on the component or on an ancestor. Each falls back to the look shown here.

  • --tui-surface
  • --tui-stroke
  • --tui-text
  • --tui-muted
  • --tui-chip
  • --tui-on-text
  • --tui-series-1
  • --tui-series-2
  • --tui-series-3
  • --tui-series-4
  • --tui-series-5
  • --tui-font-sans
  • --tui-font-mono