<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
<hk-text />Children: None. The tag is self-closing.
Props
Write props as kebab-case attributes.
| Prop | Type | Required | Default | Allowed values | Editor label |
|---|---|---|---|---|---|
text | textarea | no | "" | - | Text |
size (responsive) | number | no | - | 10 to 64 | Size |
align | select | no | - | start, center, end | Align |
color | color | no | - | - | 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:
<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:
<hk-text text="{{ block.settings.author }}" size="14" color="#4B5563" />From packages/templates-default/theme/blocks/product-excerpt.snf, lines 2 to 2:
<hk-text text="{{ product.excerpt }}" size="{{ block.settings.size }}" />Related tags
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.
