Skip to content
Hekana Spray
Documentation
Getting started
Theme development
Components and tags

Localization

Apps and custom code

Examples and recipes
API reference
Publishing
Build apps
AI development

<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

html
<hk-rich-text />

Children: None. The tag is self-closing.

Props

Write props as kebab-case attributes.

PropTypeRequiredDefaultAllowed valuesEditor label
htmlrich_textno""-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:

html
<hk-rich-text html="{{ product.description }}" />

From packages/templates-default/theme/sections/collection-main.snf, lines 7 to 7:

html
{% if collection.description %}<hk-rich-text html="{{ collection.description }}" />

From packages/templates-default/theme/sections/page-main.snf, lines 6 to 6:

html
<hk-rich-text html="{{ page.body_html }}" />
  • 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.

Next steps