CMS
Aug 28, 2025
0 views
A CMS-friendly rich-text renderer with precise spacing control, optional variable-font axes, scoped per-instance CSS injection, and a built-in HTML sanitizer (toggleable). Great for long-form articles, case-study bodies, and doc pages where you want consistent rhythm for paragraphs, lists, and headings.
//
Tags
Connect Content: Bind a CMS Rich Text field or paste HTML/markup into Content.
Typography: Choose Font family/size/weight. Enable Variable Font to expose axes and set cssFontWeight fallback.
Spacing: Tune Paragraph Gap, List Spacing (indent, item gaps, nested spacing), and Heading Spacing (H1–H6 top/bottom).
Appearance: Set Background and Radius for the container block.
Security: Leave XSS Protection on for untrusted content.
Multiple Instances: Give each block a unique Section ID (scopes the injected CSS).
Article Default: paragraphGap=16, listSpacing.indent=24, heading defaults.
Compact Docs: paragraphGap=10, listSpacing.itemGap=4, headings −25% top/bottom.
Mono Notes: variableFont=on, MONO=1, wght=450; color=#0f0 on dark bg.
Scoped Styles: A unique class from sectionId is generated; a <style> tag with calculated rules is injected and cleaned up on unmount.
Variable Fonts: When enabled, the component builds a font-variation-settings string; if wght not used, falls back to cssFontWeight.
Sanitization (optional): Strips <script>, inline on* handlers, and javascript: URLs. If disabled, a subtle “XSS Protection Off” badge appears (non-interactive).
Rendering: If content is a string, it is (optionally sanitized and) rendered via dangerouslySetInnerHTML; if it’s React nodes, they’re rendered directly.
Most work is one-time (style inject). Keep sectionId stable to avoid unnecessary de-inject/re-inject cycles.
Prefer variable axes over many separate font weights to minimize layout shifts.
For very large articles, avoid deeply nested lists to keep layout calculations trivial.
Browsers: Modern evergreen (Chrome, Edge, Safari, Firefox).
Limits: Built-in sanitizer is intentionally small; for highly untrusted inputs, consider pre-sanitizing at the CMS or using a hardened sanitizer upstream.
CMS Quirks: Some editors output empty wrappers (<p class="framer-text"></p>). The component filters common empties.
Preserves semantic tags from your CMS; ensure headings remain in logical order.
Links remain underlined by default; color choices must meet contrast guidelines.
Placeholder state announces via aria-live="polite" when no content is connected.
Data Flow: No network calls; renders the content you provide.
Sanitizer: Removes <script>, inline events, and javascript: URLs. Toggle via XSS Protection.
Risk Note: Because dangerouslySetInnerHTML is used for string content, keep sanitization on for any untrusted input.
Preserves semantic tags from your CMS; ensure headings remain in logical order.
Links remain underlined by default; color choices must meet contrast guidelines.
Placeholder state announces via aria-live="polite" when no content is connected.
Data Flow: No network calls; renders the content you provide.
Sanitizer: Removes <script>, inline events, and javascript: URLs. Toggle via XSS Protection.
Risk Note: Because dangerouslySetInnerHTML is used for string content, keep sanitization on for any untrusted input.
Authored by SecretoCho Design. Design patterns informed by common editorial systems and variable-font practices.
SecretoCho Design 2025
Provided “as is” for content/UX rendering. You’re responsible for validating accessibility, performance, and content safety for your project and data sources.
Stay ahead of the curve with insights into emerging visualization trends and technologies.