BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/contentbit/pros-cons

Pros & Cons Block

contentbit/pros-cons
FreeComponent

Paired advantages and disadvantages.

Install it

npx shadcn@latest add https://contentbit.dev/r/pros-cons.json

Source

src/blocks/pros-cons.tsxcontentbit.dev/r/pros-cons.json
1import type { BlockRenderContext } from '@contentbit/react'
2
3import { prosConsBlock, splitProsCons } from '@contentbit/blocks'
4import { defineBlockComponent } from '@contentbit/react'
5import { Check, X } from 'lucide-react'
6
7function Column({
8 heading,
9 items,
10 tone,
11 ctx,
12}: {
13 heading: string
14 items: string[]
15 tone: 'pro' | 'con'
16 ctx: BlockRenderContext
17}) {
18 const Icon = tone === 'pro' ? Check : X
19 const head =
20 tone === 'pro'
21 ? 'bg-emerald-500/[0.07] text-emerald-700 dark:text-emerald-400'
22 : 'bg-rose-500/[0.07] text-rose-700 dark:text-rose-400'
23 const mark =
24 tone === 'pro' ? 'text-emerald-600 dark:text-emerald-500' : 'text-rose-600 dark:text-rose-500'
25 return (
26 <div className="bg-card overflow-hidden rounded-lg border">
27 <div className={`flex items-center gap-2 border-b px-4 py-2.5 ${head}`}>
28 <Icon className="size-3.5" aria-hidden strokeWidth={3} />
29 <span className="text-xs font-semibold tracking-wider uppercase">{heading}</span>
30 </div>
31 <ul className="space-y-2 p-4 text-sm">
32 {items.map((text, i) => (
33 <li key={i} className="flex gap-2.5">
34 <Icon className={`mt-1 size-3.5 shrink-0 ${mark}`} aria-hidden />
35 {/* Item text is Markdown — render it, with paragraph margins zeroed. */}
36 <div className="min-w-0 leading-relaxed [&>p]:m-0">{ctx.renderMarkdown(text)}</div>
37 </li>
38 ))}
39 </ul>
40 </div>
41 )
42}
43
44export const ProsConsBlock = defineBlockComponent(prosConsBlock, ({ node, ctx }) => {
45 const { pros, cons } = splitProsCons(node.data)
46 return (
47 <div data-cb-styled className="my-6 grid gap-3 sm:grid-cols-2">
48 <Column heading="Pros" items={pros} tone="pro" ctx={ctx} />
49 <Column heading="Cons" items={cons} tone="con" ctx={ctx} />
50 </div>
51 )
52})

What it pulls in

npm packages

  • @contentbit/core
  • @contentbit/blocks
  • @contentbit/react
  • lucide-react

Files it writes

  • src/blocks/pros-cons.tsx

Facts

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

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