<hk-card>
hk-card: A box with background, radius, padding, border and shadow around its content. Syntax, props, defaults and examples.
On this page
A box with background, radius, padding, border and shadow around its content.
Group: Layout and structure. Name in the editor: Card. Complete props for every tag: Tag reference.
Syntax
<hk-card>
…
</hk-card>Children: Any content: elements, hk-* tags and text.
Props
Write props as kebab-case attributes.
| Prop | Type | Required | Default | Allowed values | Editor label |
|---|---|---|---|---|---|
background | color | no | - | - | Background |
radius | number | no | 12 | 0 to 64 | Radius |
padding (responsive) | number | no | 16 | 0 to 96 | Padding |
border | boolean | no | false | - | Border |
shadow | select | no | none | none, sm, md, lg | Shadow |
Responsive props: padding. Each also takes a tablet- and a mobile- prefix.
Required props
None. Every prop has a default or can be left out.
Examples
From docs/examples/example-store/blocks/quote.snf, lines 1 to 6:
<hk-card border="true" padding="20" radius="16">
<hk-stack gap="10">
<p class="quote">{{ block.settings.text }}</p>
<hk-text text="{{ block.settings.author }}" size="14" color="#4B5563" />
</hk-stack>
</hk-card>From docs/examples/example-store/sections/feature-row.snf, lines 5 to 10:
<hk-card border="true" padding="24" radius="16">
<hk-stack gap="8">
<hk-heading text="{{ section.settings.one_title }}" level="h3" size="20" />
<hk-text text="{{ section.settings.one_text }}" size="15" color="#4B5563" />
</hk-stack>
</hk-card>Related tags
hk-image: An image with alt text, dimensions, aspect ratio, fit, loading mode and radius.hk-heading: A heading with a level, size, alignment and colour.hk-text: A paragraph of plain text with size, alignment and colour.hk-button: A button or link with a label, destination, variant, size and optional icon.hk-section: A full-width band of the page with its own background and vertical padding.hk-container: Centres its content and limits it to a maximum width with horizontal padding.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-section-group: Marks where a shared section group (header, footer, announcement) sits in a layout.
