BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/shadcn-glass-ui/contribution-metrics-glass

Contribution Metrics Glass

shadcn-glass-ui/contribution-metrics-glass
FreeBlock

Repository contribution metrics grid displaying user and project statistics. * Extracted from RepositoryCardGlass for reusable contribution displays. * * ## Features

Install it

npx shadcn@latest add https://raw.githubusercontent.com/artyhoo/shadcn-glass-ui-library/main/public/r/contribution-metrics-glass.json

Source

components/glass/composite/contribution-metrics-glass.tsxraw.githubusercontent.com/artyhoo/shadcn-glass-ui-library/main/public/r/contribution-metrics-glass.json · first 6 KB
1// ========================================
2// CONTRIBUTION METRICS GLASS - COMPOSITE COMPONENT
3// Repository contribution metrics grid
4// Level 3: Composite (extracted from RepositoryCardGlass)
5// ========================================
6
7import { forwardRef, type HTMLAttributes, type CSSProperties } from 'react';
8import { cn } from '@/lib/utils';
9import '@/glass-theme.css';
10
11/**
12 * Props for ContributionMetricsGlass component.
13 *
14 * Extends standard div attributes for maximum flexibility.
15 * All props are readonly to ensure immutability.
16 *
17 * @example
18 * ```tsx
19 * const props: ContributionMetricsGlassProps = {
20 * userCommits: 1234,
21 * userContribution: 45,
22 * totalProjectCommits: 2744,
23 * estimatedLines: 14808,
24 * columns: 2,
25 * };
26 * ```
27 */
28export interface ContributionMetricsGlassProps extends HTMLAttributes<HTMLDivElement> {
29 /**
30 * Number of commits made by the user.
31 *
32 * Displayed in the first card as "Your Contribution" with thousand separators.
33 *
34 * @example
35 * ```tsx
36 * <ContributionMetricsGlass userCommits={1234} /> // Shows "1,234 commits"
37 * ```
38 */
39 readonly userCommits: number;
40
41 /**
42 * User's contribution percentage (0-100).
43 *
44 * Used to calculate total project commits if not provided.
45 * Displayed below user commits.
46 *
47 * @example
48 * ```tsx
49 * <ContributionMetricsGlass userContribution={45} /> // Shows "45%"
50 * ```
51 */
52 readonly userContribution: number;
53
54 /**
55 * Total project commits across all contributors.
56 *
57 * If not provided, automatically calculated from userCommits and userContribution.
58 * Calculation: `userCommits / (userContribution / 100)`
59 *
60 * @default Calculated from userCommits and userContribution
61 *
62 * @example
63 * ```tsx
64 * // Manual total
65 * <ContributionMetricsGlass totalProjectCommits={5000} />
66 *
67 * // Auto-calculated: 1000 / (50 / 100) = 2000
68 * <ContributionMetricsGlass userCommits={1000} userContribution={50} />
69 * ```
70 */
71 readonly totalProjectCommits?: number;
72
73 /**
74 * Estimated lines of code in the project.
75 *
76 * If not provided, automatically calculated as `userCommits * 12`.
77 * Displayed with thousand separators (e.g., "14,808 lines").
78 *
79 * @default userCommits * 12
80 *
81 * @example
82 * ```tsx
83 * // Manual lines
84 * <ContributionMetricsGlass estimatedLines={25000} />
85 *
86 * // Auto-calculated: 1000 * 12 = 12000
87 * <ContributionMetricsGlass userCommits={1000} />
88 * ```
89 */
90// … truncated

Facts

Registry
shadcn-glass-ui
Type
registry:block
Access
Free
Files written
0
Licence
Apache-2.0
First indexed
2026-08-02
Last confirmed
today

Go to the source

yhooi2.github.io artyhoo/shadcn-glass-ui-library on GitHub Raw registry item This item as JSON

More from shadcn-glass-ui

All 76 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Ai Card Glassai-card-glassshadcn-glass-uiBlocksFreeno deps
Career Stats Glasscareer-stats-glassshadcn-glass-uiBlocksFreeno deps
Career Stats Header Glasscareer-stats-header-glassshadcn-glass-uiBlocksFreeno deps
Circular Metric Glasscircular-metric-glassshadcn-glass-uiBlocksFreeno deps
Flags Section Glassflags-section-glassshadcn-glass-uiBlocksFreeno deps
Header Branding Glassheader-branding-glassshadcn-glass-uiBlocksFreeno deps
Header Nav Glassheader-nav-glassshadcn-glass-uiBlocksFreeno deps
Metric Card Glassmetric-card-glassshadcn-glass-uiBlocksFreeno deps
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