Saved for later folded — Storefront block
Prostorefront-saved-for-later-folded · for cart pages
Saved for later folded
A single line "Saved for later (3)" that opens on compact rows: a cart drawer or a long cart page where the saved products must not compete with the cart
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-saved-for-later-foldedUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontSavedForLaterFolded from '@/components/trame/blocks/storefront/storefront-saved-for-later-folded.vue'
const props = {
title: "Saved for later",
intro: "These aren’t reserved: their price and stock may change.",
items: [
{
id: "veste-olive",
name: "Waxed-cotton work jacket",
variant: "Size L · Olive",
price: 18900,
savedPrice: 18900,
image: "https://images.unsplash.com/photo-1673712060934-34358642511b?w=480&q=80",
alt: "Olive jackets hanging from a rail",
available: true
},
{
id: "pull-gris",
name: "Heathered wool sweater",
variant: "Size M · Gray",
price: 9900,
savedPrice: 11900,
compareAt: 11900,
image: "https://images.unsplash.com/photo-1580841831267-17e30b6b4a8b?w=480&q=80",
alt: "A gray knit sweater laid flat on a table",
available: true
}
],
actions: {
open: "product"
}
}
</script>
<template>
<StorefrontSavedForLaterFolded v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe list’s heading ("Saved for later") |
| intro | string | Wordsone line under it ("They are not reserved: their price and stock may change") |
| items* | Item[] | Datathe products set aside, as the cart tool answers them, the last set aside first |
| actions | Actions | the page actions the block runs, each described below |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
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 |
| currency | string | DesignISO 4217, EUR by default |
| image | string | null | Picturethe main picture; null or absent: the product has none yet |
| alt | string | Wordswhat the main picture shows |
| available | boolean | false: sold out; true or absent: can be bought |
| variant | string | Wordsthe options chosen when it was set aside ("Size M · Olive") |
| savedPrice | number | the price when it was set aside, in cents, as the cart tool recorded it |
| note | string | Wordswhat the shop knows about it now ("Back at the end of September") |
Actions actions · 3 props
| Prop | Type | Description |
|---|---|---|
| move | string | Actionputs a product back in the cart (default cart.restore); posts item |
| remove | string | Actiondrops a product from the list (default cart.unsave); posts item |
| open | string | Actionopens a product’s page |
Options options · 1 props
| Prop | Type | Description |
|---|---|---|
| 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
- No motion; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
actions.move,actions.remove,actions.open - Reads
cartfrom your app
A storefront section, for cart pages; it uses @lucide/vue, class-variance-authority, clsx, reka-ui, tailwind-merge.
More storefront blocks
- Reviews summary pair: a product page that wants to be believed: the most helpful positive review beside the most helpful critical one; the merchant’s own only.
- Reviews summary photo wall: reviews that come with customers’ photos: a wall of pictures, each opening its full review; the merchant’s own only.
- Saved cards card faces: Each saved card beside a neutral drawn face (its label, a chip mark, the last four digits, the expiry; no network logo): a customer with two or three cards who recognises them by sight.
- Saved cards list with explainer: The merchant’s actual storage explanation beside masked processor records and their controls.
- Saved cards list: A compact masked payment-method list for an existing account panel, with the storage statement below.
- Search landing hero search: words on one side, a search panel with the popular searches and a few products on the other: the start page of a large catalogue.
- Search landing popular and bestsellers: a wide search bar, then popular searches in one column and the products in the other: a search page before the first query.
- Search landing suggest: a large field over a live suggestions panel, the popular searches and the products narrowing as the visitor types: a large catalogue with a precise vocabulary.