The RawHtml component renders an HTML string as HTML DOM elements. This should be used for displaying rich text-like descriptions associated with a product.

The string passed to RawHtml is sanitized with isomorphic-dompurify by default. To keep the text unsanitized, set the unsanitized prop to true.

Example code


Name Type Description
string string An HTML string.
unsanitized? boolean Whether the HTML string should be sanitized with isomorphic-dompurify.

Component type

The RawHtml component is a shared component, which means that it renders on both the server and the client. For more information about component types, refer to React Server Components.

Used by