Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Render html content in rich text – Contentful + Next.js

I am building a website using Next.js and Contentful. Now I want to render html content something like <span style="font-size: 18px">View</span> in Contentful rich text. I am not sure if this is possible even.

Can you give me the solution to do this? Thank you in advance.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I did a similar solution using the @contentful/rich-text-react-renderer package.
I tried to render content like the following HTML to render buttons and tips on my website.

<div>
  <div style="width: 100%; text-align: center; font-size: 18px; font-weight: 700;">This is your journey guide!</div>
</div>

You can check more details here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading