Saved for later folded — Storefront block

Pro

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

Usage

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.

PropTypeDescription
title*stringWordsthe list’s heading ("Saved for later")
introstringWordsone 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
actionsActionsthe page actions the block runs, each described below
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
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
currencystringDesignISO 4217, EUR by default
imagestring | nullPicturethe main picture; null or absent: the product has none yet
altstringWordswhat the main picture shows
availablebooleanfalse: sold out; true or absent: can be bought
variantstringWordsthe options chosen when it was set aside ("Size M · Olive")
savedPricenumberthe price when it was set aside, in cents, as the cart tool recorded it
notestringWordswhat the shop knows about it now ("Back at the end of September")
Actions actions · 3 props
PropTypeDescription
movestringActionputs a product back in the cart (default cart.restore); posts item
removestringActiondrops a product from the list (default cart.unsave); posts item
openstringActionopens a product’s page
Options options · 1 props
PropTypeDescription
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
  • 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 cart from 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.

All 409 storefront blocks