<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-5HGSQD2L" height="0" width="0" style="display:none;visibility:hidden" title="GTM"></iframe>

Uncustomizable Markup

Use to apply SWAN styles to rich text editor of a CMS.

Use Uncustomizable Markup...

  • To style sections of content where we can’t set CSS classes, so we can’t use the SWAN APIs.

Don't use Uncustomizable Markup...

  • To save time and avoid adding CSS classes, even though we could.

Usage

Use Uncustomizable Markup around any output from the rich text editor of a CMS, if that CMS doesn't allow us to add CSS classes to the editor's output. The component will apply SWAN’s look-and-feel to any <ul>, <ol>, <table>, and heading (<h1>-<h6>) tags inside it, even if they don't have the SWAN CSS classes on them.

Share
Share

Examples

Unordered List

The preview has been updated.

Ordered List

The preview has been updated.

Table

The preview has been updated.

React Usage

Use React's dangerouslySetInnerHTML functionality if your uncustomizable content is a string:

Share

Pass children if your uncustomizable content is already transformed into a React Node:

Share

Best practices

  • This component should be placed around any output from the rich text editor of a CMS, if that CMS doesn't allow us to add CSS classes to the editor's content such as bullet lists. This applies to Sitecore, Contentful, WordPress, and others.

Props

UncustomizableMarkup
This component is implemented using the <div /> as the root element. You can utilize the native attributes supported by <div /> tag. The ref is directly assigned to the root element, allowing you to access and manipulate it as needed.
See core props for additional props that can be applied to this component.

Related

Was this page useful?

Thanks for your feedback!

Feel free to include your name if you wish to have a follow up conversation.


Markup
Published: Jan 31, 2022Last updated: Oct 16, 2024