BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/contentbit/faq

FAQ Block

contentbit/faq
FreeComponent

Accordion of question/answer pairs.

Install it

npx shadcn@latest add https://contentbit.dev/r/faq.json

Source

src/blocks/faq.tsxcontentbit.dev/r/faq.json
1import { faqBlock, type FaqItemData } from '@contentbit/blocks'
2import { defineBlockComponent } from '@contentbit/react'
3
4import {
5 Accordion,
6 AccordionContent,
7 AccordionItem,
8 AccordionTrigger,
9} from '@/components/ui/accordion'
10import { isValidatedBlock } from '@contentbit/core'
11
12export const FaqBlock = defineBlockComponent(faqBlock, ({ node, ctx }) => {
13 const data = node.data
14 return (
15 <div data-cb-styled className="bg-card my-6 rounded-lg border px-4">
16 <Accordion type="single" collapsible>
17 {data.blocks.map((item, i) => (
18 <AccordionItem
19 key={i}
20 value={`item-${i}`}
21 className={i === data.blocks.length - 1 ? 'border-b-0' : undefined}
22 >
23 <AccordionTrigger className="text-left text-sm font-medium hover:no-underline">
24 {String(item.props.question)}
25 </AccordionTrigger>
26 <AccordionContent className="text-muted-foreground text-sm leading-relaxed">
27 {ctx.renderMarkdown(
28 isValidatedBlock(item) ? (item.data as FaqItemData).markdown : item.body,
29 )}
30 </AccordionContent>
31 </AccordionItem>
32 ))}
33 </Accordion>
34 </div>
35 )
36})

What it pulls in

npm packages

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

Other registry items

  • accordion

Files it writes

  • src/blocks/faq.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