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

hk-grid: A responsive grid of columns with a gap and an optional minimum item width. Syntax, props, defaults and examples.

On this page

A responsive grid of columns with a gap and an optional minimum item width.

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

Syntax

html
<hk-grid>
  …
</hk-grid>

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

Props

Write props as kebab-case attributes.

PropTypeRequiredDefaultAllowed valuesEditor label
columns (responsive)rangeno31 to 12Columns
gap (responsive)numberno240 to 160Gap
min-itemnumberno-80 to 600Min item width

Responsive props: columns, 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/pricing.snf, lines 4 to 8:

html
<hk-grid columns="3" tablet-columns="1" gap="24">
  {% render 'plan-card', name: section.settings.plan1_name, price: section.settings.plan1_price, details: section.settings.plan1_details, best: section.settings.best == '1', variant: 'outline' %}
  {% render 'plan-card', name: section.settings.plan2_name, price: section.settings.plan2_price, details: section.settings.plan2_details, best: section.settings.best == '2', variant: 'solid' %}
  {% render 'plan-card', name: section.settings.plan3_name, price: section.settings.plan3_price, details: section.settings.plan3_details, best: section.settings.best == '3', variant: 'outline' %}
</hk-grid>

From docs/examples/example-store/sections/testimonials.snf, lines 5 to 9:

html
<hk-grid columns="3" mobile-columns="1" gap="16">
  {% for block in section.blocks %}
    <hk-block of="{{ block }}" />
  {% endfor %}
</hk-grid>
  • hk-card: A box with background, radius, padding, border and shadow around its content.
  • hk-product-card: A product card for a product, customizable through named parts.
  • hk-image: An image with alt text, dimensions, aspect ratio, fit, loading mode and radius.
  • 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-stack: Lays its children out in a row or a column with a gap, alignment and wrapping.
  • hk-section-group: Marks where a shared section group (header, footer, announcement) sits in a layout.

Next steps