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-text>

hk-text: A paragraph of plain text with size, alignment and colour. Syntax, props, defaults and examples.

On this page

A paragraph of plain text with size, alignment and colour.

Group: Text and media. Name in the editor: Text. Complete props for every tag: Tag reference.

Syntax

html
<hk-text />

Children: None. The tag is self-closing.

Props

Write props as kebab-case attributes.

PropTypeRequiredDefaultAllowed valuesEditor label
texttextareano""-Text
size (responsive)numberno-10 to 64Size
alignselectno-start, center, endAlign
colorcolorno--Colour

Responsive props: size. Each also takes a tablet- and a mobile- prefix.

Required props

None. Every prop has a default or can be left out.

Examples

From packages/templates-default/theme/sections/hero.snf, lines 16 to 20:

html
<hk-text
  text="{{ section.settings.subtitle | default: t('hero_text') }}"
  size="20"
  color="{{ section.settings.text_color }}"
/>

From docs/examples/example-store/blocks/quote.snf, lines 4 to 4:

html
<hk-text text="{{ block.settings.author }}" size="14" color="#4B5563" />

From packages/templates-default/theme/blocks/product-excerpt.snf, lines 2 to 2:

html
<hk-text text="{{ product.excerpt }}" size="{{ block.settings.size }}" />
  • hk-heading: A heading with a level, size, alignment and colour.
  • hk-rich-text: Formatted text from an HTML string, sanitized before it is rendered.
  • 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