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

hk-icon: An icon from the built-in set, with size, stroke and an accessible label. Syntax, props, defaults and examples.

On this page

An icon from the built-in set, with size, stroke and an accessible label.

Group: Text and media. Name in the editor: Icon. Complete props for every tag: Tag reference.

Syntax

html
<hk-icon name="…" />

Children: None. The tag is self-closing.

Props

Write props as kebab-case attributes.

PropTypeRequiredDefaultAllowed valuesEditor label
nameselectyes-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
sizerangeno2012 to 96Size
strokerangeno21 to 3; step 0.5Stroke
labeltextno--Label

Required props

  • name

Examples

From packages/templates-default/theme/blocks/contact-line.snf, lines 2 to 2:

html
<hk-icon name="{{ block.settings.icon }}" />

From packages/templates-default/theme/blocks/product-text.snf, lines 2 to 2:

html
{% if block.settings.icon != 'none' %}<hk-icon name="{{ block.settings.icon }}" />
  • hk-heading: A heading with a level, size, alignment and colour.
  • hk-text: A paragraph of plain text with size, alignment and colour.
  • hk-rich-text: Formatted text from an HTML string, sanitized before it is rendered.
  • hk-badge: A small label such as New or Sale, with a tone.
  • hk-image: An image with alt text, dimensions, aspect ratio, fit, loading mode and radius.
  • hk-announcement: A bar of up to six short messages that fade or scroll, optionally dismissible.

Next steps