Factory seconds flaw list — Storefront block
Prostorefront-factory-seconds-flaw-list · for home, catalog, landing pages
Factory seconds flaw list
A row per product with its defect in full, the grade scale in a column beside it: seconds where the reason matters most
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/storefront-factory-seconds-flaw-listUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontFactorySecondsFlawList from '@/components/trame/blocks/storefront/storefront-factory-seconds-flaw-list.vue'
const props = {
title: "Seconds",
lead: "A seam flaw, a dented box, a return tried on once: every piece is inspected, its flaw is written down, and its price drops to match.",
grades: [
{
grade: "A",
text: "A finishing detail or damaged packaging: the product is as good as new."
},
{
grade: "B",
text: "A cosmetic flaw visible up close, with no effect on use or durability."
}
],
items: [
{
id: 1,
name: "Open Air jacket",
price: 12900,
compareAt: 18900,
image: "https://images.unsplash.com/photo-1591047139829-d91aecb6caea?w=1600&q=80",
alt: "An orange windbreaker on a hanger",
grade: "A",
defect: "Pocket zipper came unstitched, resewn by hand. No effect on use.",
note: "One-year warranty"
},
{
id: 2,
name: "City backpack 22 L",
price: 4900,
compareAt: 7900,
image: "https://images.unsplash.com/photo-1680039211156-66c721b87625?w=1600&q=80",
alt: "A black flap backpack on a yellow background",
grade: "B",
defect: "Faint stain on the left strap that barely fades in the wash.",
note: "One-year warranty"
}
],
open: "product",
more: {
label: "See all seconds",
action: "collection",
record: {
id: "secondes"
}
},
options: {
eyebrow: "Seconds",
gradesTitle: "Our grades"
}
}
</script>
<template>
<StorefrontFactorySecondsFlawList v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat the page shows ("Seconds") |
| lead | string | Wordswhy these items are second choices, in the merchant’s own words |
| grades | Grade[] | the merchant’s grade scale |
| items* | Item[] | Datathe second-choice products, each with its grade and its defect |
| open | string | Actionthe page action a product opens; it receives the product |
| more | More | the see-more link: its words and the page action it runs |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Grade grades[] · 2 props
| Prop | Type | Description |
|---|---|---|
| grade* | string | Wordsa grade, spelled as in the products |
| text* | string | Wordswhat it means ("No visible defect, damaged packaging") |
Item items[] · 11 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 |
| image | string | null | Picturethe main picture; null or absent: the product has none yet |
| alt | string | Wordswhat the main picture shows |
| category | string | Wordsthe product’s category, e.g. "Knitwear" |
| available | boolean | false: sold out; true or absent: can be bought |
| grade* | string | Wordsthe grade the merchant gives it ("A", "B", "Refurbished") |
| defect* | string | Wordsthe honest reason it is a second ("Small ink stain on the lining, no effect on use") |
| note | string | Wordsa precision on its condition or its warranty ("One-year guarantee") |
More more · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("See all second-hand items") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
Options options · 3 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa small line above the title |
| gradesTitle | string | Wordsthe heading of the grade scale ("Our grades") |
| 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:
open,more - Reads
productsfrom your app
A storefront section, for home, catalog, landing pages; it uses @lucide/vue, class-variance-authority, clsx, motion, reka-ui, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More storefront blocks
- Digital purchase split: the words and the buy box left, the deliverables card right: a digital or service product with nothing to photograph.
- Dispatch hubs: the merchant’s dispatch places, the regions each serves, and a few real figures.
- Duties choice charges choice: cross-border orders: pay the duties now or on delivery, each with its exact amount beside a recap.
- Exchange offer list: replacements in rows with their picture, price and stock, and a plain way out to a refund: a shop that prefers to exchange.
- Express checkout wallets first: the shop offers wallet payment: wallets on top, then the card form below a divider.
- Featured offer overlay: the picture large, the offer’s words on its calm side: a strong picture; the merchant’s own only.
- Featured selection flanked: the first product in the middle on a tinted stage with its two buttons, the others flanking it in two columns like pieces either side of a shop window: one product to crown, with three to six around it; the merchant’s own products and figures only.
- Featured selection grid: the first product double-sized with two buttons, then a grid: one product to push among others; the merchant’s own products and figures only.