# How can I use richText in custom component

**URL:** <https://forum.builder.io/t/how-can-i-use-richtext-in-custom-component/5107>\
**Category:** Technical Questions\
**Tags:** react, nextjs\
**Created:** [March 6, 2024, 8:36am UTC](https://forum.builder.io/t/how-can-i-use-richtext-in-custom-component/5107 "2024-03-06T08:36:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![matrod](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@matrod](https://forum.builder.io/u/matrod)\
**Post date:** [March 6, 2024, 8:36am UTC](https://forum.builder.io/t/how-can-i-use-richtext-in-custom-component/5107/1 "2024-03-06T08:36:12Z")

</div>

Hi! Im trying to create a custom component using richText as the type. So far so good, but when I use the component in the visual editor and type in text the text displays in html. I know there is a solution where you can use dangerouslySetInnerHTML, but is there no other way to do this?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/d/d55d1042e52b8e8fbc6d7d80eb49e73e567ef1a3.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/4/43cb29aabdd344ec1d7075595468bc1f79530392.png)

---

<div class="post-metadata">

**Author:** ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)\
**Post date:** [March 6, 2024, 12:30pm UTC](https://forum.builder.io/t/how-can-i-use-richtext-in-custom-component/5107/2 "2024-03-06T12:30:46Z")

</div>

Hello @matrodz,

Welcome to the [Builder.io](http://Builder.io) forum post.

I’ve successfully reproduced the issue you’re experiencing. It appears to be a bug, and I’ll promptly share this feedback with our product team for further investigation.

In the meantime, as a workaround, you can click on the code option for the richText editor and manually remove the HTML tags if it helps alleviate the issue.

 ![Screenshot 2024-03-06 at 5.55.42 PM](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/6/6d8825211135ca353ecd40dde8d2a9f40bac9b3c.png)

---

<div class="post-metadata">

**Author:** ![matrod](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@matrod](https://forum.builder.io/u/matrod)\
**Post date:** [March 19, 2024, 3:41pm UTC](https://forum.builder.io/t/how-can-i-use-richtext-in-custom-component/5107/3 "2024-03-19T15:41:34Z")

</div>

Hi,

Thanks for your reply. Would appreciate if this was looked on and fixed, your workaround might be good for an developer or someone more used to html code, but we have copywriters and so on working in the visual editor and they might not be so keen on using that 🙂

---

<div class="post-metadata">

**Author:** ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)\
**Post date:** [March 19, 2024, 3:51pm UTC](https://forum.builder.io/t/how-can-i-use-richtext-in-custom-component/5107/4 "2024-03-19T15:51:44Z")

</div>

Hello @matrod,

I wanted to inform you that a request has been raised for our product team to investigate this matter further. Rest assured, I will keep you updated as soon as any progress is made.

Thank you for your patience.

---

<div class="post-metadata">

**Author:** ![order\_matters](https://avatars.discourse-cdn.com/v4/letter/o/b4bc9f/32.png) [@order\_matters](https://forum.builder.io/u/order_matters)\
**Post date:** [July 15, 2025, 8:15pm UTC](https://forum.builder.io/t/how-can-i-use-richtext-in-custom-component/5107/5 "2025-07-15T20:15:37Z")

</div>

I’m still experiencing this issue. Any updates?

---

<div class="post-metadata">

**Author:** ![order\_matters](https://avatars.discourse-cdn.com/v4/letter/o/b4bc9f/32.png) [@order\_matters](https://forum.builder.io/u/order_matters)\
**Post date:** [July 15, 2025, 9:26pm UTC](https://forum.builder.io/t/how-can-i-use-richtext-in-custom-component/5107/6 "2025-07-15T21:26:56Z")

</div>

Self-solved. I was building a FAQ component in React (JSX).

The richText input was for `answer`, I was passing it as a child `<div>{answer}</div>` and seeing

and   
 tags after editing…  
now I’m using dangerouslySetInnerHTML:  
`<div dangerouslySetInnerHTML={{ __html: answer }}></div>`

ChatGPT indicated this could work: `<RichText content={answer} />` but I didn’t see where RichText was exported anywhere.

I also just found this answer from a previous Identical thread:

> [@How do i use the Rich text/html prop?](https://forum.builder.io/t/how-do-i-use-the-rich-text-html-prop/4383):
>
> I have this component: export function Text({ label }) { return \<p\>{label}\</p\>; } Builder.registerComponent(Text, { name: 'Text', inputs: [{ name: 'text', type: 'html', },], }); The html is displayed as it is, with the tags. how do i render the html/richtext as text?
