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

hk-button: A button or link with a label, destination, variant, size and optional icon. Syntax, props, defaults and examples.

On this page

A button or link with a label, destination, variant, size and optional icon.

Group: Navigation and forms. Name in the editor: Button. Complete props for every tag: Tag reference.

Syntax

html
<hk-button />

Children: None. The tag is self-closing.

Props

Write props as kebab-case attributes.

PropTypeRequiredDefaultAllowed valuesEditor label
labeltextno""-Label
hreflinkno#-Link
variantselectnosolidsolid, outline, ghostStyle
sizeselectnomdsm, md, lgSize
iconselectno-arrow-left, arrow-right, arrow-up-right, chevron-left, chevron-right, chevron-down, chevron-up, check, x, plus, minus, menu, search, shopping-cart, shopping-bag, heart, star, user, mail, phone, map-pin, truck, package, gift, tag, credit-card, wallet, banknote, percent, clock, calendar, download, upload, file, file-text, image, play, pause, volume-2, globe, lock, shield-check, info, alert-circle, help-circle, message-circle, share-2, external-link, link, copy, trash-2, settings, filter, sliders-horizontal, grid, list, home, store, sparkles, zap, flame, trophy, gamepad-2, headphones, monitor, smartphone, book-open, graduation-cap, code, layers, key, cpu, cable, chart-no-axes-column, radio-tower, battery-charging, plug, wrenchIcon
icon-positionselectnostartstart, endIcon position

Required props

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

Examples

From packages/templates-default/theme/sections/footer.snf, lines 14 to 18:

html
<hk-button
  label="{{ section.settings.newsletter_label | default: t('newsletter_cta') }}"
  href="{{ section.settings.newsletter_link }}"
  variant="outline"
/>

From docs/examples/example-store/sections/product-grid.snf, lines 6 to 6:

html
<hk-button label="{{ t('view_all') }}" href="/collections/featured" variant="ghost" />

From packages/templates-default/theme/snippets/button.snf, lines 1 to 1:

html
{% if label %}<hk-button label="{{ label }}" href="{{ href }}" variant="{{ style }}" />

Next steps