Tags
On this page
For Astro, there is a helper library that makes the integration process of rich texts very simple.
To install, use npm or another package manager:
npm install @caisy/rich-text-astro-renderer --save
For ease of use, just pass the JSON and the component will convert it to HTML:
---
import RichTextRenderer from '@caisy/rich-text-astro-renderer';
...
---
<RichTextRenderer node={blogArticle.text.json} />
To ensure that you pass the correct object, it should contain something like this:
{ type: "doc", ... }
An example using the rich text render with Astro can also be found here on Stackblitz:
https://stackblitz.com/github/caisy-io/caisy-example-astro
Tags
On this page