<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
<hk-icon name="…" />Children: None. The tag is self-closing.
Props
Write props as kebab-case attributes.
| Prop | Type | Required | Default | Allowed values | Editor label |
|---|---|---|---|---|---|
name | select | yes | - | 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, wrench | Icon |
size | range | no | 20 | 12 to 96 | Size |
stroke | range | no | 2 | 1 to 3; step 0.5 | Stroke |
label | text | no | - | - | Label |
Required props
name
Examples
From packages/templates-default/theme/blocks/contact-line.snf, lines 2 to 2:
<hk-icon name="{{ block.settings.icon }}" />From packages/templates-default/theme/blocks/product-text.snf, lines 2 to 2:
{% if block.settings.icon != 'none' %}<hk-icon name="{{ block.settings.icon }}" />Related tags
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.
