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

hk-container: Centres its content and limits it to a maximum width with horizontal padding. Syntax, props, defaults and examples.

On this page

Centres its content and limits it to a maximum width with horizontal padding.

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

Syntax

html
<hk-container>
  …
</hk-container>

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

Props

Write props as kebab-case attributes.

PropTypeRequiredDefaultAllowed valuesEditor label
max-widthnumberno-200 to 1920Max width
padding-x (responsive)numberno160 to 120Horizontal padding

Responsive props: padding-x. 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/announcement-bar.snf, lines 3 to 11:

html
<hk-container>
  <p class="sf-announcement-text">
    {% if section.settings.link %}
      <a href="{{ url(section.settings.link) }}">{{ section.settings.text }}</a>
    {% else %}
      {{ section.settings.text }}
    {% endif %}
  </p>
</hk-container>

From docs/examples/example-store/layout/theme.snf, lines 6 to 8:

html
<hk-container>
  <hk-text text="{{ store.name }}" size="14" />
</hk-container>

From packages/templates-default/theme/sections/footer.snf, lines 2 to 15:

html
<hk-container>
  {% if section.settings.show_newsletter %}
    <div class="sf-newsletter">
      <div>
        {% if section.settings.newsletter_title %}
          <h2 class="sf-footer-title">{{ section.settings.newsletter_title }}</h2>
        {% endif %}
        {% if section.settings.newsletter_text %}
          <p>{{ section.settings.newsletter_text }}</p>
        {% endif %}
      </div>
      {% if section.settings.newsletter_link %}
        <hk-button
          label="{{ section.settings.newsletter_label | default: t('newsletter_cta') }}"
  • hk-stack: Lays its children out in a row or a column with a gap, alignment and wrapping.
  • hk-grid: A responsive grid of columns with a gap and an optional minimum item width.
  • hk-heading: A heading with a level, size, alignment and colour.
  • hk-section: A full-width band of the page with its own background and vertical padding.
  • 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