Hekla Knitwear
Lopapeysa wool sweater
Sale price 18.990 kr. Regular price 23.990 kr.
These components show things: products, prices, stock, people, pictures and icons. They also cover the moments in between, when a list is empty or still loading.
Props that take an icon expect a Vue component that draws an <svg>. The examples import them from @tabler/icons-vue, but any icon component works.
Badge is a short label on a product or in a list, such as "New" or "−20%". StockBadge says whether a product is in stock.
<script setup lang="ts">
import { Badge, StockBadge } from '@eldrajs/ui';
import { IconLeaf } from '@tabler/icons-vue';
</script>
<template>
<Badge variant="new" label="New" />
<Badge variant="sale" label="−20%" hidden-suffix=" off" />
<Badge tone="success" :icon="IconLeaf" label="Organic wool" />
<Badge outline label="Sold out" />
<Badge pill label="Knitwear" />
<StockBadge level="in" />
<StockBadge level="low" :quantity="3" />
<StockBadge level="out" />
</template>| Prop | Default | What it does |
|---|---|---|
label | none | The badge text. You can also put the text in the default slot. |
variant | 'none' | 'sale' or 'new' gives the badge its fixed shop colour. |
tone | 'neutral' | The colour: neutral, primary, accent, success, warning or danger. |
icon | none | A small icon before the text. |
hiddenSuffix | none | Extra words only screen readers hear, such as " off" after "−20%". |
level (StockBadge) | required | 'in', 'low', 'out' or 'preorder'. Picks the colour, icon and text. |
quantity (StockBadge) | none | The number in the low-stock text, such as "only 3 left". |
message (StockBadge) | none | Your own text instead of the default one. |
TIP
A success, warning or danger badge needs an icon. Colour alone is not enough for people who cannot see it.
Price formats an amount in the shop's currency, with the old price struck through during a sale.
18.990 kr.
Sale price 18.990 kr. Regular price 23.990 kr.
From 4.490 kr.
<script setup lang="ts">
import { Price } from '@eldrajs/ui';
</script>
<template>
<Price :amount="18990" currency="ISK" locale="is-IS" />
<Price :amount="18990" :compare-at="23990" currency="ISK" locale="is-IS" size="lg" />
<Price :amount="4490" from currency="ISK" locale="is-IS" size="sm" />
</template>| Prop | Default | What it does |
|---|---|---|
amount | required | The price in minor units. ISK has none, so 18990 shows as 18.990 kr. |
compareAt | none | The old price. When it is higher than amount, the price shows as a sale. |
currency | the app's currency | An ISO 4217 code, such as 'ISK' or 'EUR'. |
locale | the app's locale | How the number is written, such as 'is-IS' or 'en-GB'. |
size | 'md' | 'sm', 'md' or 'lg'. |
from | false | Adds "From" before the price, for products whose variants cost different amounts. |
TIP
Always pass amounts in minor units. 1299 is 12,99 € in euros but 1.299 kr in krónur.
Rating shows a product's average review score as stars, with the number of reviews.
<script setup lang="ts">
import { Rating } from '@eldrajs/ui';
</script>
<template>
<Rating :value="4.5" :count="128" />
<Rating :value="4" :count="12" href="#reviews" size="lg" />
<Rating :value="0" />
</template>| Prop | Default | What it does |
|---|---|---|
value | required | The average score out of 5. It is drawn to the nearest half star. |
count | 0 | How many reviews there are. With 0, the rating shows a "no reviews yet" state. |
showValue | true | Shows the number, such as "4.5", next to the stars. |
showCount | true | Shows the review count. |
href | none | Makes the whole rating a link to the reviews. |
size | 'md' | 'md' or 'lg'. |
ProductCard is the product tile for grids, carousels and search results. It shows the picture, title, price, rating, colours and a quick-add button.
Hekla Knitwear
Sale price 18.990 kr. Regular price 23.990 kr.
5.990 kr.
4.490 kr.
<script setup lang="ts">
import { ref } from 'vue';
import { ProductCard } from '@eldrajs/ui';
const sweater = {
title: 'Lopapeysa wool sweater',
url: '/products/lopapeysa',
vendor: 'Hekla Knitwear',
featuredImage: {
src: '/images/lopapeysa.jpg',
alt: 'Oatmeal wool sweater, folded',
width: 640,
height: 800,
},
price: { amount: 18990, compareAt: 23990 },
rating: { value: 4.5, count: 128 },
colours: [
{ name: 'Oatmeal', swatch: '#e7ded1' },
{ name: 'Charcoal', swatch: '#2f2f2f' },
{ name: 'Moss', swatch: '#4d5a45' },
{ name: 'Clay', swatch: '#8c3b2a' },
],
badge: { variant: 'sale' as const },
stock: 'low' as const,
};
const beanie = {
title: 'Ribbed wool beanie',
url: '/products/ribbed-beanie',
featuredImage: { src: '/images/beanie.jpg', alt: 'Navy ribbed beanie', width: 640, height: 800 },
price: { amount: 5990 },
badge: { variant: 'new' as const },
};
const mittens = {
title: 'Patterned mittens',
url: '/products/patterned-mittens',
featuredImage: {
src: '/images/mittens.jpg',
alt: 'Red patterned mittens',
width: 640,
height: 800,
},
price: { amount: 4490 },
available: false,
};
const lastAdded = ref('');
function onQuickAdd(product: { title: string }) {
lastAdded.value = product.title;
}
</script>
<template>
<div
style="display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1.5rem"
>
<ProductCard
:product="sweater"
show-vendor
currency="ISK"
locale="is-IS"
@quick-add="onQuickAdd"
/>
<ProductCard :product="beanie" currency="ISK" locale="is-IS" @quick-add="onQuickAdd" />
<ProductCard :product="mittens" currency="ISK" locale="is-IS" @quick-add="onQuickAdd" />
<p v-if="lastAdded">Added to cart: {{ lastAdded }}</p>
</div>
</template>| Prop | Default | What it does |
|---|---|---|
product | required | The product: title, url and price are required; picture, rating, colours, badge and stock are optional. |
quickAdd | true | Shows the quick-add button. Clicking it emits quick-add with the product. |
showVendor | false | Shows the brand or maker above the title. |
ratio | '4x5' | The picture's shape: '4x5', '1x1' or '3x4'. |
currency | the app's currency | The currency the price is shown in. |
loading | false | Draws a placeholder card while the product loads. |
TIP
Set available: false on a sold-out product. The card then dims the picture, shows "Sold out" and disables quick add.
ContentCard links to a journal post, guide or collection, with a picture, a short excerpt and a date.
Journal
From the autumn round-up to the spinning mill: a short guide to where your sweater starts.
· 4 min read
Update
Order by 18 December for delivery in Iceland before Christmas.
Read the update<script setup lang="ts">
import { ContentCard } from '@eldrajs/ui';
const journalImage = {
src: '/images/sheep.jpg',
alt: 'Sheep grazing on a green hillside',
width: 900,
height: 600,
};
</script>
<template>
<div
style="display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.5rem"
>
<ContentCard
title="How Icelandic wool is spun"
href="/journal/how-wool-is-spun"
:image="journalImage"
eyebrow="Journal"
excerpt="From the autumn round-up to the spinning mill: a short guide to where your sweater starts."
date="2026-11-14"
meta="4 min read"
locale="en-GB"
/>
<ContentCard
title="Winter delivery dates"
href="/journal/winter-delivery"
variant="surface"
eyebrow="Update"
excerpt="Order by 18 December for delivery in Iceland before Christmas."
cue="Read the update"
/>
</div>
</template>| Prop | Default | What it does |
|---|---|---|
title | required | The heading, which is also the link text. |
href | required | Where the card links to. |
image | none | The picture at the top. Without one, the card gets a filled background. |
excerpt | none | A sentence or two about the content. Long text is cut off after three lines. |
date | none | A date as YYYY-MM-DD. It is written out in the card's locale. |
variant | 'plain' | 'plain', 'surface' or 'outlined'. |
FeatureCard states one shop promise with an icon, such as free shipping or easy returns.
Orders within Iceland arrive in two to four working days.
Spun and knitted in Iceland, with no synthetic fibres.
<script setup lang="ts">
import { FeatureCard } from '@eldrajs/ui';
import { IconLeaf, IconRecycle, IconTruck } from '@tabler/icons-vue';
</script>
<template>
<div
style="display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1.5rem"
>
<FeatureCard
:icon="IconTruck"
title="Free shipping over 15.000 kr."
body="Orders within Iceland arrive in two to four working days."
/>
<FeatureCard
:icon="IconRecycle"
title="30-day returns"
body="Send it back unworn and we refund you in full."
href="/returns"
variant="surface"
/>
<FeatureCard
:icon="IconLeaf"
title="Pure Icelandic wool"
body="Spun and knitted in Iceland, with no synthetic fibres."
variant="outlined"
/>
</div>
</template>| Prop | Default | What it does |
|---|---|---|
icon | required | The icon in the tile. It is decorative: the title carries the meaning. |
title | required | A short, concrete fact. |
body | required | One or two sentences that explain it. |
href | none | Makes the whole card a link, with a "Learn more" cue. |
cue | "Learn more" | The cue text on a linked card. |
variant | 'plain' | 'plain', 'surface' or 'outlined'. |
Image shows a picture in a fixed shape, so the page does not jump while it loads.
<script setup lang="ts">
import { Image } from '@eldrajs/ui';
const scarfPhoto = {
src: '/images/scarf.jpg',
alt: 'Oatmeal wool scarf on a wooden table',
width: 800,
height: 600,
};
</script>
<template>
<div
style="display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1.5rem"
>
<Image :media="scarfPhoto" ratio="4x3" rounded="lg" />
<Image
:media="scarfPhoto"
ratio="1x1"
:focal="{ x: 50, y: 40 }"
caption="Oatmeal scarf, 180 cm"
/>
<Image :media="null" ratio="4x3" />
</div>
</template>| Prop | Default | What it does |
|---|---|---|
media | none | The picture: src, alt, width, height. Without it, a placeholder shows. |
alt | media.alt | What the picture shows, for people who cannot see it. |
ratio | '4x3' | The frame's shape, such as '1x1', '16x9' or 'auto'. |
focal | centre | The point to keep in view when the picture is cropped, in percent. |
priority | false | Loads the picture straight away. Use it for the first big picture on a page. |
decorative | false | Hides a purely decorative picture from screen readers. |
TIP
Every picture that means something needs alt text. Turn on decorative only for pictures that add nothing to the page's meaning.
Avatar shows a person's photo, or their initials when there is no photo. AvatarGroup shows a few people in an overlapping row.
<script setup lang="ts">
import { Avatar, AvatarGroup } from '@eldrajs/ui';
const makers = [
{ name: 'Guðrún Jónsdóttir' },
{ name: 'Sigríður Ólafsdóttir' },
{ name: 'Anna Björk' },
{ name: 'Helga Stefánsdóttir' },
{ name: 'Þóra Magnúsdóttir' },
];
</script>
<template>
<Avatar name="Guðrún Jónsdóttir" size="sm" />
<Avatar name="Guðrún Jónsdóttir" size="md" />
<Avatar name="Guðrún Jónsdóttir" size="lg" :decorative="false" />
<AvatarGroup :people="makers" label="Our knitters" />
</template>| Prop | Default | What it does |
|---|---|---|
src | none | The photo, as a URL or a media object. |
name | none | The person's name. Used for the initials when there is no photo. |
size | 'md' | 'sm', 'md', 'lg' or 'xl'. |
decorative | true | Leave it on when the name is printed next to the avatar. Turn it off when the avatar stands alone. |
people (AvatarGroup) | required | The people, each with a name and an optional src. |
label (AvatarGroup) | required | What the group is, such as "Our knitters". Screen readers hear it before the names. |
TIP
A group shows at most three avatars. Everyone else is counted in a "+N" circle.
LogoItem shows one brand or stockist logo in a logo row. Without a logo file, it shows the name as text.
<script setup lang="ts">
import { LogoItem } from '@eldrajs/ui';
</script>
<template>
<LogoItem name="Hekla Knitwear" />
<LogoItem name="Reykjavík Wool Co." href="/stockists/reykjavik-wool" />
</template>| Prop | Default | What it does |
|---|---|---|
name | required | The brand's name. It is the logo's alt text, or the text shown when there is no logo. |
logo | none | The logo file, ideally an SVG or a transparent PNG. |
href | none | Makes the logo a link. |
linkContext | "(stockist site)" on links to other sites | Extra words screen readers hear after the name. |
Icon draws an icon component at one of the library's sizes. TablerIcon draws any Tabler icon by its name, which suits icons an editor picks in Studio.
<script setup lang="ts">
import { Icon, TablerIcon } from '@eldrajs/ui';
import { IconHeart } from '@tabler/icons-vue';
</script>
<template>
<Icon :icon="IconHeart" size="sm" />
<Icon :icon="IconHeart" size="md" />
<Icon :icon="IconHeart" size="lg" label="Saved to wishlist" />
<TablerIcon name="shopping-cart" size="lg" />
<TablerIcon name="truck-delivery" size="lg" />
<TablerIcon name="heart-filled" size="xl" label="Favourite" />
</template>| Prop | Default | What it does |
|---|---|---|
icon (Icon) | required | The icon component to draw. |
name (TablerIcon) | none | A Tabler icon name in kebab case, such as 'shopping-cart'. |
size | 'md' | 'sm', 'md', 'lg' or 'xl'. |
label | none | Names the icon for screen readers. Without it, the icon is hidden from them. |
strokeWidth (TablerIcon) | 1.75 | The line thickness, for a site that draws icons heavier or lighter. |
TIP
Give an icon a label only when it stands alone. An icon next to text that says the same thing should stay unlabelled.
EmptyState fills the space when there is nothing to show: an empty cart, a search with no results, or a list that failed to load.
Check the spelling or try a broader word.
Check your connection and try again.
<script setup lang="ts">
import { ref } from 'vue';
import { Button, EmptyState } from '@eldrajs/ui';
const retrying = ref(false);
function onRetry() {
retrying.value = true;
setTimeout(() => {
retrying.value = false;
}, 1500);
}
</script>
<template>
<div
style="display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.5rem"
>
<EmptyState title="Your cart is empty" text="Find something warm in the knitwear collection.">
<template #actions>
<Button variant="primary" href="/collections/knitwear" label="Shop knitwear" />
</template>
</EmptyState>
<EmptyState
variant="noResults"
title="No results for “lopi”"
text="Check the spelling or try a broader word."
/>
<EmptyState
variant="error"
title="We could not load the products"
text="Check your connection and try again."
:retrying="retrying"
@retry="onRetry"
/>
</div>
</template>| Prop | Default | What it does |
|---|---|---|
title | required | What happened, in a few words. |
text | none | One or two sentences with the next step. |
variant | 'empty' | 'empty', 'noResults' or 'error'. Each has its own default icon. |
icon | per variant | Your own icon instead of the default one. |
retrying | false | Shows the "Try again" button as busy. The error variant emits retry when it is clicked. |
plain | false | Drops the border and background, for use inside a drawer or card. |
TIP
Always give the reader one next step: a button in the actions slot, or the built-in "Try again" on an error.
Skeleton draws grey shapes where content will appear, so the layout stays still while data loads.
<script setup lang="ts">
import { Skeleton } from '@eldrajs/ui';
</script>
<template>
<div
style="display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1.5rem"
>
<div>
<Skeleton variant="media" ratio="4x5" />
<Skeleton variant="title" />
<Skeleton variant="text" :lines="2" />
</div>
<div style="display: flex; gap: 0.75rem; align-items: center">
<Skeleton variant="circle" size="3rem" />
<Skeleton variant="text" :lines="2" width="10rem" />
</div>
<Skeleton variant="btn" busy-label="Loading cart…" />
</div>
</template>| Prop | Default | What it does |
|---|---|---|
variant | 'text' | The shape: text, title, circle, media, btn or box. |
lines | 1 | How many lines a text skeleton draws. |
width | full width | Any CSS width, such as '10rem' or '60%'. |
ratio | '4x5' | The shape of a media skeleton. |
busyLabel | none | Tells screen readers what is loading, such as "Loading products…". |
TIP
Skeletons are hidden from screen readers. Give one busyLabel to the area that is loading, not one to every shape.
Spinner is a small turning circle for a short wait, such as adding an item to the cart.
<script setup lang="ts">
import { Spinner } from '@eldrajs/ui';
</script>
<template>
<Spinner />
<Spinner label="Updating your cart" />
</template>| Prop | Default | What it does |
|---|---|---|
label | none | Names the spinner for screen readers. Without it, the spinner is hidden from them. |
TIP
A button that is busy already has its own spinner: use Button's loading prop instead of placing a Spinner in it.