The `contentful-rich-text-vue-renderer` package, currently at stable version 3.2.1, provides a robust solution for rendering Contentful Rich Text fields within Vue 3 applications. It parses the Contentful Rich Text JSON structure and converts it into native Vue components, allowing for seamless integration of rich content. The library is actively maintained with regular patch and minor releases, as evidenced by recent updates fixing warnings and adding support for new marks. A key differentiator is its direct compatibility with Vue 3's composition API and rendering functions (e.g., `h`), while older 2.x versions supported Vue 2. It requires `@contentful/rich-text-types` as a peer dependency, which defines the expected structure of the rich text document and its various node and mark types. This package simplifies displaying rich content managed in Contentful without needing to manually parse and render complex JSON structures. Releases typically include dependency updates and new feature support for rich text marks/nodes.
npm install contentful-rich-text-vue-rendererVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to render a Contentful Rich Text document, including custom renderers for bold marks and paragraphs, and a placeholder for an embedded entry block. It uses Vue 3's Composition API `<script setup>`.
For Vue 3 projects, upgrade to `^3.0.0`. For Vue 2 projects, ensure `contentful-rich-text-vue-renderer@2.x.x` is used and avoid upgrading to version 3.
Upgrade to version 3.2.1 or newer to resolve the extraneous non-props attributes warning. If upgrading is not possible, explicitly disable attribute inheritance for the component or use `$attrs` if you need to pass attributes through.
Ensure your project uses Node.js 10 or higher when working with `contentful-rich-text-vue-renderer@2.x.x`.
Ensure `@contentful/rich-text-types` is explicitly installed in your project and matches the peer dependency range. Use `npm install @contentful/rich-text-types@^17.0.0` or `yarn add @contentful/rich-text-types@^17.0.0`.
Ensure you have `import RichTextRenderer from 'contentful-rich-text-vue-renderer';` at the top of your script and that the component is registered (e.g., within the `components` option or automatically via `<script setup>`).
Verify that your project is configured for Vue 3 and that `h` is imported as a named export: `import { h } from 'vue';`. Also, ensure you are on `contentful-rich-text-vue-renderer@3.x.x`.Install the required peer dependency: `npm install @contentful/rich-text-types@^17.0.0` or `yarn add @contentful/rich-text-types@^17.0.0`. Adjust the version as needed to match the acceptable range.