Comparison Block (Astro)
contentbit/astro-comparisonFreeComponent
Two-option comparison table.
Install it
npx shadcn@latest add https://contentbit.dev/r/astro-comparison.jsonSource
1---2import type { ComparisonData } from '@contentbit/blocks'3import type { ValidatedBlockNode } from '@contentbit/core'45interface Props {6 node: ValidatedBlockNode<unknown>7 left?: string8 right?: string9}1011const { node, left, right } = Astro.props12const data = node.data as ComparisonData13---1415<div data-cb-styled class="bg-card my-6 overflow-x-auto rounded-lg border">16 <table class="w-full text-sm">17 <thead>18 <tr class="bg-muted/50 border-b">19 <th scope="col" class="w-[28%] px-4 py-3 text-left font-medium" />20 <th scope="col" class="px-4 py-3 text-left"><span class="font-semibold">{left}</span></th>21 <th scope="col" class="px-4 py-3 text-left"><span class="font-semibold">{right}</span></th>22 </tr>23 </thead>24 <tbody class="divide-y">25 {26 data.rows.map((row) => (27 <tr class="hover:bg-muted/30 transition-colors">28 <th scope="row" class="text-muted-foreground px-4 py-3 text-left text-[13px] font-medium">29 {row.label}30 </th>31 <td class="px-4 py-3 tabular-nums">{row.left}</td>32 <td class="px-4 py-3 tabular-nums">{row.right}</td>33 </tr>34 ))35 }36 </tbody>37 </table>38</div>
What it pulls in
npm packages
Files it writes
More from contentbit
All 20 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Callout Block (Astro)astro-callout | contentbit | Components | Free | 3 deps | |
| Content Renderer (Astro)astro-content-renderer | contentbit | Components | Free | 3 deps | |
| FAQ Block (Astro)astro-faq | contentbit | Components | Free | 3 deps | |
| Key Metrics Block (Astro)astro-key-metrics | contentbit | Components | Free | 3 deps | |
| Pros & Cons Block (Astro)astro-pros-cons | contentbit | Components | Free | 3 deps | |
| Quick Reference Block (Astro)astro-quick-ref | contentbit | Components | Free | 3 deps | |
| Steps Block (Astro)astro-steps | contentbit | Components | Free | 3 deps | |
| Tabs Block (Astro)astro-tabs | contentbit | Components | Free | 3 deps |
