<hk-rich-text>
hk-rich-text: Formatted text from an HTML string, sanitized before it is rendered. Syntax, props, defaults and examples.
On this page
Formatted text from an HTML string, sanitized before it is rendered.
Group: Text and media. Name in the editor: Rich text. Complete props for every tag: Tag reference.
Syntax
<hk-rich-text />Children: None. The tag is self-closing.
Props
Write props as kebab-case attributes.
| Prop | Type | Required | Default | Allowed values | Editor label |
|---|---|---|---|---|---|
html | rich_text | no | "" | - | Rich text |
Required props
None. Every prop has a default or can be left out.
Examples
From packages/templates-default/theme/blocks/product-description.snf, lines 6 to 6:
<hk-rich-text html="{{ product.description }}" />From packages/templates-default/theme/sections/collection-main.snf, lines 7 to 7:
{% if collection.description %}<hk-rich-text html="{{ collection.description }}" />From packages/templates-default/theme/sections/page-main.snf, lines 6 to 6:
<hk-rich-text html="{{ page.body_html }}" />Related tags
hk-heading: A heading with a level, size, alignment and colour.hk-text: A paragraph of plain text with size, alignment and colour.hk-badge: A small label such as New or Sale, with a tone.hk-image: An image with alt text, dimensions, aspect ratio, fit, loading mode and radius.hk-icon: An icon from the built-in set, with size, stroke and an accessible label.hk-announcement: A bar of up to six short messages that fade or scroll, optionally dismissible.
