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

hk-heading: A heading with a level, size, alignment and colour. Syntax, props, defaults and examples.

On this page

A heading with a level, size, alignment and colour.

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

Syntax

html
<hk-heading />

Children: None. The tag is self-closing.

Props

Write props as kebab-case attributes.

PropTypeRequiredDefaultAllowed valuesEditor label
texttextno""-Text
levelselectnoh2h1, h2, h3, h4Level
size (responsive)numberno-12 to 160Size
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/blocks/product-title.snf, lines 1 to 6:

html
<hk-heading
  text="{{ product.title }}"
  level="{{ block.settings.level }}"
  size="{{ block.settings.size }}"
  mobile-size="{{ block.settings.mobile_size }}"
/>

From docs/examples/example-store/sections/promo-hero.snf, lines 6 to 13:

html
<hk-heading
  text="{{ section.settings.title }}"
  level="h1"
  size="56"
  tablet-size="44"
  mobile-size="32"
  color="#FFFFFF"
/>

From packages/templates-default/theme/sections/hero.snf, lines 9 to 15:

html
<hk-heading
  text="{{ section.settings.title | default: t('hero_title') }}"
  level="h1"
  size="52"
  mobile-size="32"
  color="{{ section.settings.text_color }}"
/>
  • hk-text: A paragraph of plain text with 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