Skip to content

Display and commerce ​

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, StockBadge ​

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.

New−20% offOrganic woolSold outKnitwearIn stock, ships in 1–2 daysLow stock: only 3 leftSold out
vue
<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>
PropDefaultWhat it does
labelnoneThe 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.
iconnoneA small icon before the text.
hiddenSuffixnoneExtra 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)noneThe number in the low-stock text, such as "only 3 left".
message (StockBadge)noneYour 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 ​

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.

vue
<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>
PropDefaultWhat it does
amountrequiredThe price in minor units. ISK has none, so 18990 shows as 18.990 kr.
compareAtnoneThe old price. When it is higher than amount, the price shows as a sale.
currencythe app's currencyAn ISO 4217 code, such as 'ISK' or 'EUR'.
localethe app's localeHow the number is written, such as 'is-IS' or 'en-GB'.
size'md''sm', 'md' or 'lg'.
fromfalseAdds "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 ​

Rating shows a product's average review score as stars, with the number of reviews.

No reviews yet
vue
<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>
PropDefaultWhat it does
valuerequiredThe average score out of 5. It is drawn to the nearest half star.
count0How many reviews there are. With 0, the rating shows a "no reviews yet" state.
showValuetrueShows the number, such as "4.5", next to the stars.
showCounttrueShows the review count.
hrefnoneMakes the whole rating a link to the reviews.
size'md''md' or 'lg'.

ProductCard ​

ProductCard is the product tile for grids, carousels and search results. It shows the picture, title, price, rating, colours and a quick-add button.

Oatmeal wool sweater, folded
−21% off

Hekla Knitwear

Lopapeysa wool sweater

Sale price 18.990 kr. Regular price 23.990 kr.

Low stock
Available in 4 colours
vue
<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>
PropDefaultWhat it does
productrequiredThe product: title, url and price are required; picture, rating, colours, badge and stock are optional.
quickAddtrueShows the quick-add button. Clicking it emits quick-add with the product.
showVendorfalseShows the brand or maker above the title.
ratio'4x5'The picture's shape: '4x5', '1x1' or '3x4'.
currencythe app's currencyThe currency the price is shown in.
loadingfalseDraws 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 ​

ContentCard links to a journal post, guide or collection, with a picture, a short excerpt and a date.

Sheep grazing on a green hillside

Journal

How Icelandic wool is spun

From the autumn round-up to the spinning mill: a short guide to where your sweater starts.

· 4 min read

vue
<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>
PropDefaultWhat it does
titlerequiredThe heading, which is also the link text.
hrefrequiredWhere the card links to.
imagenoneThe picture at the top. Without one, the card gets a filled background.
excerptnoneA sentence or two about the content. Long text is cut off after three lines.
datenoneA date as YYYY-MM-DD. It is written out in the card's locale.
variant'plain''plain', 'surface' or 'outlined'.

FeatureCard ​

FeatureCard states one shop promise with an icon, such as free shipping or easy returns.

Free shipping over 15.000 kr.

Orders within Iceland arrive in two to four working days.

30-day returns

Send it back unworn and we refund you in full.

Pure Icelandic wool

Spun and knitted in Iceland, with no synthetic fibres.

vue
<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>
PropDefaultWhat it does
iconrequiredThe icon in the tile. It is decorative: the title carries the meaning.
titlerequiredA short, concrete fact.
bodyrequiredOne or two sentences that explain it.
hrefnoneMakes 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 ​

Image shows a picture in a fixed shape, so the page does not jump while it loads.

Oatmeal wool scarf on a wooden table
Oatmeal wool scarf on a wooden table
Oatmeal scarf, 180 cm
vue
<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>
PropDefaultWhat it does
medianoneThe picture: src, alt, width, height. Without it, a placeholder shows.
altmedia.altWhat the picture shows, for people who cannot see it.
ratio'4x3'The frame's shape, such as '1x1', '16x9' or 'auto'.
focalcentreThe point to keep in view when the picture is cropped, in percent.
priorityfalseLoads the picture straight away. Use it for the first big picture on a page.
decorativefalseHides 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, AvatarGroup ​

Avatar shows a person's photo, or their initials when there is no photo. AvatarGroup shows a few people in an overlapping row.

Our knitters: Guðrún Jónsdóttir, Sigríður Ólafsdóttir, Anna Björk and 2 more
vue
<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>
PropDefaultWhat it does
srcnoneThe photo, as a URL or a media object.
namenoneThe person's name. Used for the initials when there is no photo.
size'md''sm', 'md', 'lg' or 'xl'.
decorativetrueLeave it on when the name is printed next to the avatar. Turn it off when the avatar stands alone.
people (AvatarGroup)requiredThe people, each with a name and an optional src.
label (AvatarGroup)requiredWhat 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 ​

LogoItem shows one brand or stockist logo in a logo row. Without a logo file, it shows the name as text.

  • Hekla Knitwear
  • Reykjavík Wool Co.
  • vue
    <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>
    PropDefaultWhat it does
    namerequiredThe brand's name. It is the logo's alt text, or the text shown when there is no logo.
    logononeThe logo file, ideally an SVG or a transparent PNG.
    hrefnoneMakes the logo a link.
    linkContext"(stockist site)" on links to other sitesExtra words screen readers hear after the name.

    Icon, TablerIcon ​

    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.

    vue
    <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>
    PropDefaultWhat it does
    icon (Icon)requiredThe icon component to draw.
    name (TablerIcon)noneA Tabler icon name in kebab case, such as 'shopping-cart'.
    size'md''sm', 'md', 'lg' or 'xl'.
    labelnoneNames the icon for screen readers. Without it, the icon is hidden from them.
    strokeWidth (TablerIcon)1.75The 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 ​

    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.

    Your cart is empty

    Find something warm in the knitwear collection.

    No results for “lopi”

    Check the spelling or try a broader word.

    vue
    <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>
    PropDefaultWhat it does
    titlerequiredWhat happened, in a few words.
    textnoneOne or two sentences with the next step.
    variant'empty''empty', 'noResults' or 'error'. Each has its own default icon.
    iconper variantYour own icon instead of the default one.
    retryingfalseShows the "Try again" button as busy. The error variant emits retry when it is clicked.
    plainfalseDrops 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 ​

    Skeleton draws grey shapes where content will appear, so the layout stays still while data loads.

    vue
    <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>
    PropDefaultWhat it does
    variant'text'The shape: text, title, circle, media, btn or box.
    lines1How many lines a text skeleton draws.
    widthfull widthAny CSS width, such as '10rem' or '60%'.
    ratio'4x5'The shape of a media skeleton.
    busyLabelnoneTells 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 ​

    Spinner is a small turning circle for a short wait, such as adding an item to the cart.

    vue
    <script setup lang="ts">
    import { Spinner } from '@eldrajs/ui';
    </script>
    
    <template>
      <Spinner />
      <Spinner label="Updating your cart" />
    </template>
    PropDefaultWhat it does
    labelnoneNames 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.

    Eldra