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

hk-price: Formats a price, with an optional compare-at price, for a product or a fixed amount. Syntax, props, defaults and examples.

On this page

Formats a price, with an optional compare-at price, for a product or a fixed amount.

Group: Product. Name in the editor: Price. Complete props for every tag: Tag reference.

Syntax

html
<hk-price />

Children: None. The tag is self-closing.

Props

Write props as kebab-case attributes.

PropTypeRequiredDefaultAllowed valuesEditor label
amountnumberno--Price
compare-atnumberno--Compare at
formatselectno-decimal, wholeNumber format
productdatano--Product with variants

Required props

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

Examples

From packages/templates-default/theme/snippets/price.snf, lines 2 to 2:

html
<hk-price amount="{{ product.price }}" compare-at="{{ product.compare_at }}" product="{{ product }}" />

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

html
<hk-price amount="{{ p.price }}" compare-at="{{ p.compare_at }}" />

Next steps