List ranked — Article block
Proarticle-list-ranked · for article, home pages
List ranked
Big numerals and pictures alternating sides: a ranking or a countdown the visitor reads with pleasure
Documentation
Installation
One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).
pnpm dlx shadcn-vue@latest add @trame/article-list-rankedUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import ArticleListRanked from '@/components/trame/blocks/article/article-list-ranked.vue'
const props = {
title: "8 ways to make your bag last",
lead: "From storage to repair: what we tell people every week at the workshop.",
items: [
{
title: "Let it breathe",
text: "A bag stored in plastic sweats. Keep it in the open air, in a cotton dust bag, away from the radiator.",
image: "https://images.unsplash.com/photo-1473188588951-666fce8e7c68?w=1600&q=80",
alt: "A patinated brown leather satchel resting on a block of stone"
},
{
title: "Condition the leather twice a year",
text: "A dab of cream, a soft cloth, ten minutes. The leather stays supple and the patina grows richer.\n\nAvoid household oils: they stain.",
image: "https://images.unsplash.com/photo-1637759292654-a12cb2be085e?w=1600&q=80",
alt: "Cognac-brown leather, a close-up of a fold and a seam",
link: {
label: "Read the care guide",
action: "article",
record: {
id: "entretien"
}
}
}
],
options: {
eyebrow: "Workshop tips"
}
}
</script>
<template>
<ArticleListRanked v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe article’s title ("8 ways to make a bag last") |
| lead | string | Wordswhat the list is for, in two lines |
| items* | Item[] | the items shown, in order |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Item items[] · 6 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe item’s title |
| text* | string | Wordsthe entry’s text; a blank line starts a new paragraph |
| image | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the picture shows |
| product | Product | Datathe product the entry points to, if any |
| link | Link | the link: its words and the page action it runs |
Product items[].product · 19 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe product’s name |
| price* | number | an amount in cents |
| compareAt | number | the price before the merchant’s reduction |
| currency | string | DesignISO 4217, EUR by default |
| image | string | null | Picturethe main picture; null or absent: the product has none yet |
| images | string[] | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the main picture shows |
| brand | string | Wordsthe brand or maker |
| category | string | Wordsthe product’s category, e.g. "Knitwear" |
| summary | string | Wordsone short line on the product |
| badge | string | Wordsa short tag the merchant set ("New", "Handmade") |
| rating | number | the average of the shop’s own stored reviews |
| reviewCount | number | how many stored reviews the rating averages |
| available | boolean | false: sold out; true or absent: can be bought |
| stock | number | the real stock, when the merchant shows it |
| maxQuantity | number | the most one order may hold of it, as the merchant set it (one per customer, a limited run) |
| options | Option[] | the product’s options and their values, e.g. sizes |
| highlights | Highlight[] | a few key facts the merchant set, shown on the product’s card |
Option items[].product.options[] · 2 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe option’s name, e.g. "Size" |
| values* | string[] | Wordsits values, e.g. "S", "M", "L" |
Highlight items[].product.highlights[] · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe property ("Material", "Capacity") |
| value* | string | Wordsits value, as the merchant states it ("Washed linen", "50 cl") |
Link items[].link · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhere it leads ("Read the full guide") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action applies to, passed to the host with it, if any |
Options options · 3 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsthe section ("Tips") |
| countdown | boolean | number from the last to the first, as in a countdown list |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
What it asks your app for
The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| money | formats a price, given in cents |
| asset | a picture’s address as your app serves it |
| Link | your router’s link component |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your word for an interface key, or undefined to keep the block’s own |
The words it says itself, in English and French; label(key) replaces any of them:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too many attempts, try again in a moment. | Trop de tentatives, réessayez dans un moment. |
Features
- Every word in the server HTML
- Same markup in Vue and React
- Theme tokens only: every theme, light and dark
- Shows what you give it, invents nothing
- Subtle motion: one short reveal; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
items[].link
A article section, for article, home pages; it uses @lucide/vue, clsx, motion, tailwind-merge.
More article blocks
- Layout prose: an ordinary article: a centred reading column, the cover wide above it, topics and the next reads below.
- Layout split header: a feature or a launch story with a portrait or square cover: the cover beside the title, standfirst and byline (and the opening quote, when the article starts on one), the body centred below.
- Layout steps: a how-to: a strip of key facts, then numbered steps each with its picture.
- Long guide toc rail: a long guide with several headings: a sticky "on this page" rail with the article’s dates beside the text.
- Passage strip cards: Equal excerpt cards for real extracts of linked articles only.
- Passage strip stacked big: One large opening extract and a quiet reading list, for real linked extracts only.
- Quiz all at once: every question in one column, the score at the end: a short quiz read like an article.
- Quiz cards: questions as cards side by side: a light quiz of three to six questions that invites a try.