Content Renderer (Astro)
contentbit/astro-content-rendererFreeComponent
Renders a validated Content Blocks document with the styled component pack.
Install it
npx shadcn@latest add https://contentbit.dev/r/astro-content-renderer.jsonSource
1---2import type { ProcessedDocumentNode } from '@contentbit/core'3import type { ComponentProps } from 'astro/types'45import { ContentBlocks } from '@contentbit/astro/components'67import Callout from './callout.astro'8import Comparison from './comparison.astro'9import Faq from './faq.astro'10import KeyMetrics from './key-metrics.astro'11import ProsCons from './pros-cons.astro'12import QuickRef from './quick-ref.astro'13import Steps from './steps.astro'14import Tabs from './tabs.astro'1516// The styled pack, keyed by block name. Add your custom blocks via the17// `components` prop — they merge over these.18const styledComponents: Record<string, unknown> = {19 callout: Callout,20 steps: Steps,21 'key-metrics': KeyMetrics,22 'quick-ref': QuickRef,23 comparison: Comparison,24 'pros-cons': ProsCons,25 tabs: Tabs,26 faq: Faq,27}2829interface Props {30 document: ProcessedDocumentNode31 components?: Record<string, unknown>32 /**33 * Host prose pipeline for Markdown between block islands and nested block34 * children. Pass your Astro/Satteri renderer here if the rest of your site35 * uses Astro's Markdown processor.36 */37 renderMarkdown?: ComponentProps<typeof ContentBlocks>['renderMarkdown']38 onInvalid?: 'strict' | 'annotated' | 'fallback'39}4041const { document, components, renderMarkdown, onInvalid } = Astro.props42---4344<ContentBlocks45 document={document}46 components={{ ...styledComponents, ...components }}47 renderMarkdown={renderMarkdown}48 onInvalid={onInvalid}49/>
What it pulls in
npm packages
Other registry items
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 | |
| Comparison Block (Astro)astro-comparison | 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 |
