BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/contentbit/astro-pros-cons

Pros & Cons Block (Astro)

contentbit/astro-pros-cons
FreeComponent

Paired advantages and disadvantages.

Install it

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

Source

src/astro/pros-cons.astrocontentbit.dev/r/astro-pros-cons.json
1---
2import type { ProsConsData } from '@contentbit/blocks'
3import type { ValidatedBlockNode } from '@contentbit/core'
4import type { AstroBlockContext } from '@contentbit/astro'
5
6import { splitProsCons } from '@contentbit/blocks'
7
8interface Props {
9 node: ValidatedBlockNode<unknown>
10 ctx: AstroBlockContext
11}
12
13const { node, ctx } = Astro.props
14const { pros, cons } = splitProsCons(node.data as ProsConsData)
15const [renderedPros, renderedCons] = await Promise.all([
16 Promise.all(pros.map((item) => ctx.renderMarkdown(item))),
17 Promise.all(cons.map((item) => ctx.renderMarkdown(item))),
18])
19
20// Inline lucide paths: check, x.
21const CHECK = '<path d="M20 6 9 17l-5-5"/>'
22const X = '<path d="M18 6 6 18"/><path d="m6 6 12 12"/>'
23
24const columns = [
25 {
26 heading: 'Pros',
27 items: renderedPros,
28 path: CHECK,
29 head: 'bg-emerald-500/[0.07] text-emerald-700 dark:text-emerald-400',
30 mark: 'text-emerald-600 dark:text-emerald-500',
31 },
32 {
33 heading: 'Cons',
34 items: renderedCons,
35 path: X,
36 head: 'bg-rose-500/[0.07] text-rose-700 dark:text-rose-400',
37 mark: 'text-rose-600 dark:text-rose-500',
38 },
39]
40---
41
42<div data-cb-styled class="my-6 grid gap-3 sm:grid-cols-2">
43 {
44 columns.map((col) => (
45 <div class="bg-card overflow-hidden rounded-lg border">
46 <div class:list={['flex items-center gap-2 border-b px-4 py-2.5', col.head]}>
47 <svg
48 xmlns="http://www.w3.org/2000/svg"
49 viewBox="0 0 24 24"
50 fill="none"
51 stroke="currentColor"
52 stroke-width="3"
53 stroke-linecap="round"
54 stroke-linejoin="round"
55 class="size-3.5"
56 aria-hidden="true"
57 set:html={col.path}
58 />
59 <span class="text-xs font-semibold tracking-wider uppercase">{col.heading}</span>
60 </div>
61 <ul class="list-none space-y-2 p-4 text-sm">
62 {col.items.map((html) => (
63 <li class="flex gap-2.5">
64 <svg
65 xmlns="http://www.w3.org/2000/svg"
66 viewBox="0 0 24 24"
67 fill="none"
68 stroke="currentColor"
69 stroke-width="2.5"
70 stroke-linecap="round"
71 stroke-linejoin="round"
72 class:list={['mt-1 size-3.5 shrink-0', col.mark]}
73 aria-hidden="true"
74 set:html={col.path}
75 />
76 <div class="min-w-0 leading-relaxed [&>p]:m-0" set:html={html} />
77 </li>
78// … truncated

What it pulls in

npm packages

  • @contentbit/core
  • @contentbit/blocks
  • @contentbit/astro

Files it writes

  • src/astro/pros-cons.astro

Facts

Registry
contentbit
Type
registry:component
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-03
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
Quick Reference Block (Astro)astro-quick-refcontentbitComponentsFree3 deps
Steps Block (Astro)astro-stepscontentbitComponentsFree3 deps
Tabs Block (Astro)astro-tabscontentbitComponentsFree3 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