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/metric-card-glass

Metric Card Glass

shadcn-glass-ui/metric-card-glass
FreeBlock

Rich metric display card with progress bars, sparklines, and trend indicators. * Follows shadcn/ui variant system with Glass UI extensions for data visualization. * * ## Features

Install it

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

Source

components/glass/composite/metric-card-glass.tsxraw.githubusercontent.com/artyhoo/shadcn-glass-ui-library/main/public/r/metric-card-glass.json · first 6 KB
1/**
2 * MetricCardGlass Component
3 *
4 * Rich metric display card with progress bars, sparklines, and trend indicators.
5 * Follows shadcn/ui variant system with Glass UI extensions for data visualization.
6 *
7 * ## Features
8 * - 5 semantic variants (default, secondary, success, warning, destructive)
9 * - Trend indicators with directional arrows (up/down/neutral)
10 * - Optional progress bar with gradient colors matched to variant
11 * - Optional sparkline chart for trend visualization
12 * - Flexible change display (string, number, or detailed MetricChange object)
13 * - Score ratio display (e.g., "85/100") via maxScore prop
14 * - Optional explain button with HelpCircle icon
15 * - Hover lift effect via InteractiveCard primitive
16 * - Responsive sizing (sm, md, lg text scales)
17 * - Theme-aware with per-variant CSS variables
18 *
19 * ## CSS Variables
20 * Per-variant variables (5 variants × 4 properties = 20 variables):
21 * - `--metric-default-bg`, `--metric-default-text`, `--metric-default-border`, `--metric-default-glow`
22 * - `--metric-secondary-bg`, `--metric-secondary-text`, `--metric-secondary-border`, `--metric-secondary-glow`
23 * - `--metric-success-bg`, `--metric-success-text`, `--metric-success-border`, `--metric-success-glow`
24 * - `--metric-warning-bg`, `--metric-warning-text`, `--metric-warning-border`, `--metric-warning-glow`
25 * - `--metric-destructive-bg`, `--metric-destructive-text`, `--metric-destructive-border`, `--metric-destructive-glow`
26 *
27 * @example Basic metric card (shadcn/ui style)
28 * ```tsx
29 * import { MetricCardGlass } from 'shadcn-glass-ui'
30 * import { DollarSign } from 'lucide-react'
31 *
32 * function Dashboard() {
33 * return (
34 * <MetricCardGlass
35 * title="Total Revenue"
36 * value="$45,231"
37 * change="+12.5%"
38 * variant="success"
39 * icon={<DollarSign className="w-4 h-4" />}
40 * />
41 * )
42 * }
43 * ```
44 *
45 * @example With progress bar and sparkline
46 * ```tsx
47 * <MetricCardGlass
48 * title="Completion Rate"
49 * value="85%"
50 * description="Project milestones"
51 * change={{ value: 5.2, direction: 'up', period: 'vs last month' }}
52 * variant="success"
53 * progress={85}
54 * sparklineData={[70, 75, 78, 80, 82, 84, 85]}
55 * showProgress
56 * showSparkline
57 * />
58 * ```
59 *
60 * @example Score ratio display
61 * ```tsx
62 * <MetricCardGlass
63 * title="Test Coverage"
64 * value={92}
65 * maxScore={100}
66 * description="Unit tests"
67 * variant="success"
68 * progress={92}
69 * showProgress
70 * />
71 * // Displays: "92/100"
72// … 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
Contribution Metrics Glasscontribution-metrics-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
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