BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/contentbit/key-metrics

Key Metrics Block

contentbit/key-metrics
FreeComponent

Stat cards for scannable numbers.

Install it

npx shadcn@latest add https://contentbit.dev/r/key-metrics.json

Source

src/blocks/key-metrics.tsxcontentbit.dev/r/key-metrics.json
1import { keyMetricsBlock } from '@contentbit/blocks'
2import { defineBlockComponent } from '@contentbit/react'
3
4import { cn } from '@/lib/utils'
5
6// Static map so Tailwind can see the class names.
7const COLS: Record<number, string> = {
8 1: 'sm:grid-cols-1',
9 2: 'sm:grid-cols-2',
10 3: 'sm:grid-cols-3',
11 4: 'sm:grid-cols-4',
12}
13
14export const KeyMetricsBlock = defineBlockComponent(keyMetricsBlock, ({ node }) => {
15 const data = node.data
16 const cols = COLS[Math.min(data.rows.length, 4)]
17 return (
18 <div data-cb-styled className={cn('my-6 grid grid-cols-2 gap-3', cols)}>
19 {data.rows.map((row, i) => (
20 <div
21 key={i}
22 className="bg-card relative overflow-hidden rounded-lg border px-4 pt-4 pb-3.5"
23 >
24 <span
25 className="via-foreground/20 absolute inset-x-0 top-0 h-px bg-gradient-to-r from-transparent to-transparent"
26 aria-hidden
27 />
28 <div className="text-2xl font-bold tracking-tight tabular-nums sm:text-[1.75rem]">
29 {row.value}
30 </div>
31 <div className="text-muted-foreground mt-1 truncate font-mono text-[11px] tracking-wide uppercase">
32 {row.label}
33 </div>
34 </div>
35 ))}
36 </div>
37 )
38})

What it pulls in

npm packages

  • @contentbit/core
  • @contentbit/blocks
  • @contentbit/react

Files it writes

  • src/blocks/key-metrics.tsx

Facts

Registry
contentbit
Type
registry:component
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

contentbit.dev agonist/contentbit on GitHub Raw registry item This item as JSON

More from contentbit

All 20 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Callout Block (Astro)astro-calloutcontentbitComponentsFree3 deps
Comparison Block (Astro)astro-comparisoncontentbitComponentsFree3 deps
Content Renderer (Astro)astro-content-renderercontentbitComponentsFree3 deps
FAQ Block (Astro)astro-faqcontentbitComponentsFree3 deps
Key Metrics Block (Astro)astro-key-metricscontentbitComponentsFree3 deps
Pros & Cons Block (Astro)astro-pros-conscontentbitComponentsFree3 deps
Quick Reference Block (Astro)astro-quick-refcontentbitComponentsFree3 deps
Steps Block (Astro)astro-stepscontentbitComponentsFree3 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