Express checkout wallets first — Storefront block

Pro

storefront-express-checkout-wallets-first · for checkout pages

Express checkout wallets first

The shop offers wallet payment: wallets on top, then the card form below a divider

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-express-checkout-wallets-first

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontExpressCheckoutWalletsFirst from '@/components/trame/blocks/storefront/storefront-express-checkout-wallets-first.vue'

const props = {
title: "Complete your order",
intro: "Shipping to the contiguous US, Canada and Mexico.",
lines: [
{
id: 1,
product: {
id: 1,
name: "Lightweight rain jacket",
image: "https://images.unsplash.com/photo-1694561418303-16393986b86d?w=1600&q=80",
alt: "Lightweight rain jacket"
},
unitPrice: 12900,
quantity: 1,
variant: "Forest green · M"
},
{
id: 2,
product: {
id: 2,
name: "Backpack 24 L",
image: "https://images.unsplash.com/photo-1602845860431-35374f24f48d?w=1600&q=80",
alt: "Backpack 24 L"
},
unitPrice: 8900,
quantity: 1,
variant: "Sand"
}
],
totals: {
subtotal: 26200,
shipping: null,
tax: 4367,
taxIncluded: true,
total: 26200
},
countries: [
{
code: "US",
name: "United States"
},
{
code: "CA",
name: "Canada"
}
],
shippingOptions: [
{
id: "standard",
name: "Home delivery",
price: 490,
arrival: "Arrives October 14–16",
note: "Parcel tracking by email"
},
{
id: "express",
name: "Express 24h",
price: 1190,
arrival: "Arrives October 13"
}
],
wallets: [
{
id: "apple-pay",
label: "Apple Pay",
kind: "applepay"
},
{
id: "paypal",
label: "PayPal",
kind: "paypal"
}
],
actions: {
place: "place-order",
wallet: "wallet-pay",
back: "cart",
signIn: "sign-in"
},
options: {
guest: true,
simulated: true,
newsletter: "Get new arrivals and offers by email",
payNote: "Your card is charged when your order ships."
}
}
</script>

<template>
<StorefrontExpressCheckoutWalletsFirst v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
title*stringWordsthe page’s heading ("Complete the order")
introstringWordsone line under the heading, if the merchant has something to say (a delay, a contact)
lines*Line[]Datathe cart’s lines, as the server prices them
totals*TotalsDatathe cart’s totals from the server: shipping null until a way to ship is chosen
countriesCountry[]Datathe countries the shop delivers to; the first is the default
shippingOptionsShippingOption[]Datathe ways to ship, with price and arrival from the shipping tool
onlyShippingbooleanthe shop has one way to ship that serves this order (the first of shippingOptions): shown as a fact, nothing to choose
wallets*Wallet[]Datathe express payment methods the merchant has configured
savedAddressSavedAddressDatathe signed-in customer’s address
savedMethodSavedMethodDatathe signed-in customer’s saved payment method (masked by the processor)
customerstringWordswho is signed in ("Camille Martin · [email protected]")
actionsActionsthe page actions the block runs, each described below
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Line lines[] · 8 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
product*Productthe product on the line
variantstringWordsthe chosen options, written out ("Navy · 42")
unitPrice*numberan amount in cents
compareAtnumberan amount in cents
quantity*numberhow many, at least 1
maxQuantitynumberthe most the line may hold
notestringWordsa line note: a gift, a delivery delay
Product lines[].product · 4 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
name*stringWordsthe product’s name
imagestring | nullPicturethe main picture; null or absent: the product has none yet
altstringWordswhat the main picture shows
Totals totals · 11 props
PropTypeDescription
subtotal*numberan amount in cents
discountnumberan amount in cents
discountLabelstringWordswhat the discount is, e.g. a code’s name
shippingnumber | nullnull: computed at the next step
shippingLabelstringWordsthe delivery method, e.g. "Standard delivery"
feesnumberfees the shop charges on top (service, handling), when it does
feesLabelstringWordswhat the fees are ("Service fee")
taxnumberan amount in cents
taxIncludedbooleantrue: the prices include tax
total*numberan amount in cents
currencystringDesignISO 4217, EUR by default
Country countries[] · 2 props
PropTypeDescription
code*stringthe country’s ISO code, e.g. "FR"
name*stringthe country’s name
ShippingOption shippingOptions[] · 5 props
PropTypeDescription
id*stringthe shipping option’s id
name*stringthe shipping option’s name
price*numberits price in cents; 0 when free
arrivalstringwhen it arrives, as the shop writes it
notestringa short note on this delivery option
Wallet wallets[] · 4 props
PropTypeDescription
id*stringthe wallet’s id
label*stringthe wallet’s name, as shown
kind'visa' | 'mastercard' | 'americanexpress' | 'cb' | 'paypal' | 'applepay' | 'googlepay' | 'klarna' | 'transfer' | 'cash' | 'voucher'which method it is: without a mark, picks a generic glyph for a wallet, a phone or a card (never the provider’s logo)
markstringPicturethe wallet’s official mark, supplied by the host (never drawn by the block): shown in its button, the label as its alt
SavedAddress savedAddress · 7 props
PropTypeDescription
name*stringWordsthe recipient’s name
line1*stringWordsstreet and number
line2stringWordsa second address line: building, floor
postalCode*stringWordsthe postcode
city*stringWordsthe town
country*stringWordsthe country
phonestringWordsa phone number for the delivery
SavedMethod savedMethod · 2 props
PropTypeDescription
label*stringthe saved method’s name, as shown
detailstringa precision on it, e.g. "expires 08/27"
Actions actions · 6 props
PropTypeDescription
placestringActionplaces the order with the form’s values; without act the form posts them to its address
quotestringActionre-prices the cart when the country or the way to ship changes, through a host that runs actions; posts country and shipping
walletstringActionstarts a wallet payment (`{ id }`): the host opens the wallet’s own sheet; no action, no wallet button
donestringActionwhere a placed order leads (its confirmation), with the data the place action answered
backstringActionthe cart page
signInstringActionthe sign-in page
Options options · 6 props
PropTypeDescription
guestbooleansay that an account is not needed
shippingbooleansomething ships: false hides the address (digital goods); true by default
simulatedbooleanpayments are a demo: say it plainly
newsletterstringWordsthe label of an opt-in checkbox (unchecked); no label, no checkbox
payNotestringWordsone sentence of the merchant’s real payment policy, beside the pay button ("Your card is charged at shipping.")
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 }
gonavigates after a success
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
cart.feesFeesFrais
cart.shippingShippingLivraison
cart.subtotalSubtotalSous-total
cart.totalTotalTotal
checkout.address1AddressAdresse
checkout.address2Apartment, suite, etc.Complément d’adresse
checkout.backToCartBack to cartRetour au panier
checkout.bagBagPanier
checkout.cardCardCarte bancaire
checkout.checkFieldCheck this field.Vérifiez ce champ.
checkout.chooseShippingChoose a shipping method.Choisissez un mode de livraison.
checkout.cityCityVille
checkout.contactContactContact
checkout.continueContinueContinuer
checkout.continueToContinue to {step}Continuer vers {step}
checkout.countryCountryPays
checkout.deliveryDeliveryLivraison
checkout.discountDiscountRéduction
checkout.editEditModifier
checkout.emptyYour cart is empty.Votre panier est vide.
checkout.expressWithPay with {method}Payer avec {method}
checkout.freeFreeGratuite
checkout.fullNameFull nameNom complet
checkout.guestYou do not need an account to order.Pas besoin de compte pour commander.
checkout.invalidEmailEnter a valid email address.Saisissez une adresse e-mail valide.
checkout.item1 item1 article
checkout.items{count} items{count} articles
checkout.noteSentTo {place}Vers {place}
checkout.notYetCalculated at the next stepCalculée à l’étape suivante
checkout.orCardor pay by cardou payer par carte
checkout.payPay {amount}Payer {amount}
checkout.paymentPaymentPaiement
checkout.phonePhoneTéléphone
checkout.postalCodePostal codeCode postal
checkout.quantityQuantityQuantité
checkout.requiredThis field is required.Ce champ est obligatoire.
checkout.saveSaveEnregistrer
checkout.shippingMethodShipping methodMode de livraison
checkout.signedInAsSigned in: {who}Connecté : {who}
checkout.signInAlready a customer? Sign inDéjà client ? Se connecter
checkout.simulatedDemo payment: no card is charged.Paiement de démonstration : aucune carte n’est débitée.
checkout.stepOfStep {n} of {total}Étape {n} sur {total}
checkout.summaryOrder summaryRécapitulatif
checkout.taxTaxTVA
checkout.taxInclincl. taxdont TVA
checkout.totalToPayTotal to payTotal à payer
form.emailEmail addressAdresse e-mail
form.optionaloptionalfacultatif
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: checkout.place, checkout.quote, checkout.wallet, actions.done, actions.back, actions.signIn
  • Reads cart, shipping_options from your app

A storefront section, for checkout pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.

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.
  • 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.
  • Factory seconds grid: product cards with the grade on the picture and the defect told under the name: a rail of seconds on a home or catalogue page.
  • 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.

All 409 storefront blocks