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

hk-stack: Lays its children out in a row or a column with a gap, alignment and wrapping. Syntax, props, defaults and examples.

On this page

Lays its children out in a row or a column with a gap, alignment and wrapping.

Group: Layout and structure. Name in the editor: Stack. Complete props for every tag: Tag reference.

Syntax

html
<hk-stack>
  …
</hk-stack>

Children: Any content: elements, hk-* tags and text.

Props

Write props as kebab-case attributes.

PropTypeRequiredDefaultAllowed valuesEditor label
direction (responsive)selectnocolumnrow, columnDirection
gap (responsive)numberno160 to 160Gap
alignselectno-start, center, end, stretchAlign
justifyselectno-start, center, end, betweenJustify
wrapbooleannofalse-Wrap

Responsive props: direction, gap. Each also takes a tablet- and a mobile- prefix.

Required props

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

Examples

From docs/examples/example-store/sections/announcement-bar.snf, lines 2 to 7:

html
<hk-stack direction="row" mobile-direction="column" gap="12" mobile-gap="4" align="center" justify="center">
  <hk-text text="{{ section.settings.message }}" size="15" align="center" color="#FFFFFF" />
  {% if section.settings.link_label %}
    <a class="announcement-link" href="{{ section.settings.link }}">{{ section.settings.link_label }}</a>
  {% endif %}
</hk-stack>

From docs/examples/example-store/sections/on-sale.snf, lines 8 to 13:

html
<hk-stack direction="row" gap="8" align="center">
  {% if p.compare_at > p.price %}
    <hk-badge text="{{ t('sale') }}" tone="accent" />
  {% endif %}
  <hk-price amount="{{ p.price }}" compare-at="{{ p.compare_at }}" />
</hk-stack>
  • hk-heading: A heading with a level, size, alignment and colour.
  • hk-text: A paragraph of plain text with size, alignment and colour.
  • hk-button: A button or link with a label, destination, variant, size and optional icon.
  • hk-section: A full-width band of the page with its own background and vertical padding.
  • hk-container: Centres its content and limits it to a maximum width with horizontal padding.
  • hk-grid: A responsive grid of columns with a gap and an optional minimum item width.
  • hk-card: A box with background, radius, padding, border and shadow around its content.
  • hk-section-group: Marks where a shared section group (header, footer, announcement) sits in a layout.

Next steps