Factory seconds flaw list — Storefront block

Pro

storefront-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-list

Usage

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.

PropTypeDescription
title*stringWordswhat the page shows ("Seconds")
leadstringWordswhy these items are second choices, in the merchant’s own words
gradesGrade[]the merchant’s grade scale
items*Item[]Datathe second-choice products, each with its grade and its defect
openstringActionthe page action a product opens; it receives the product
moreMorethe see-more link: its words and the page action it runs
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Grade grades[] · 2 props
PropTypeDescription
grade*stringWordsa grade, spelled as in the products
text*stringWordswhat it means ("No visible defect, damaged packaging")
Item items[] · 11 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
name*stringWordsthe product’s name
price*numberan amount in cents
compareAtnumberthe price before the merchant’s reduction
imagestring | nullPicturethe main picture; null or absent: the product has none yet
altstringWordswhat the main picture shows
categorystringWordsthe product’s category, e.g. "Knitwear"
availablebooleanfalse: sold out; true or absent: can be bought
grade*stringWordsthe grade the merchant gives it ("A", "B", "Refurbished")
defect*stringWordsthe honest reason it is a second ("Small ink stain on the lining, no effect on use")
notestringWordsa precision on its condition or its warranty ("One-year guarantee")
More more · 3 props
PropTypeDescription
label*stringWordswhat happens ("See all second-hand items")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens, if any
Options options · 3 props
PropTypeDescription
eyebrowstringWordsa small line above the title
gradesTitlestringWordsthe heading of the grade scale ("Our grades")
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa 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).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
moneyformats a price, given in cents
asseta picture’s address as your app serves it
Linkyour router’s link component
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour 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:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo 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 products from 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.

All 409 storefront blocks