Payment instalments plan schedule — Storefront block

Pro

storefront-payment-instalments-plan-schedule · for checkout pages

Payment instalments plan schedule

The provider offers pay-in-full or N payments: the chosen plan shows its dated schedule and any extra cost

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-payment-instalments-plan-schedule

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontPaymentInstalmentsPlanSchedule from '@/components/trame/blocks/storefront/storefront-payment-instalments-plan-schedule.vue'

const props = {
title: "Payment",
intro: "Choose how to pay for your order.",
total: 25930,
methods: [
{
id: "apple-pay",
label: "Apple Pay",
kind: "wallet"
},
{
id: "paypal-express",
label: "PayPal",
kind: "wallet"
}
],
plans: [
{
id: "x3",
label: "Pay in 3 installments",
count: 3,
amount: 8644,
total: 25930,
extra: 0,
schedule: [
{
date: "Today",
amount: 8646
},
{
date: "November 12",
amount: 8642
}
]
},
{
id: "x10",
label: "Pay in 10 installments",
count: 10,
amount: 2760,
total: 27600,
extra: 1670,
apr: "14.2%",
schedule: [
{
date: "Today",
amount: 2760
},
{
date: "November 12",
amount: 2760
}
]
}
],
action: {
label: "Pay",
action: "place-order"
},
reassurance: "Your card is charged when your order ships. Refunds within 5 business days if you return it.",
options: {
saveCard: true,
simulated: true
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe step’s heading ("Payment")
introstringWordsone line above the choice
total*numberDatathe cart total in cents, from the server
methods*Method[]Datathe methods the merchant has configured: none offered, none shown
plans*Plan[]Datainstalment plans offered by the provider for this cart
actionActionthe call to action: its words and the page action it runs
reassurancestringWordsthe merchant’s real payment policy, one sentence, near the button ("Charged at shipping.")
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Method methods[] · 4 props
PropTypeDescription
id*stringthe method’s id
label*stringthe method’s name, as shown
kind*'wallet' | 'card' | 'paypal' | 'transfer' | 'other'what kind of method it is: wallet, card, paypal, transfer, other
notestringone sentence on how it works; for a transfer, the instructions
Plan plans[] · 8 props
PropTypeDescription
id*stringthe plan’s id
label*string"Pay in 3 instalments"
count*numberhow many, as the host counted them
amount*numbercents per payment
total*numbercents, all payments together
extranumbercents the plan costs over the cart price; 0 only when the provider says it is free
aprstringthe rate as the provider states it
scheduleSchedule[]the instalments, each a date and an amount
Schedule plans[].schedule[] · 2 props
PropTypeDescription
date*stringwhen it is charged, as the shop writes it
amount*numberthe instalment in cents
Action action · 2 props
PropTypeDescription
label*stringWordsthe pay button’s verb ("Pay")
action*stringActionpays: `{ method, plan, saveCard? }` (plan: `full` or the plan’s id); without act the form posts them to its address
Options options · 3 props
PropTypeDescription
saveCardbooleanoffer "save this card" (unchecked by default)
simulatedbooleanpayments are a demo: say it plainly
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
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: checkout.pay
  • Reads payment_methods from your app

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

More storefront blocks

  • Party details lead plus names: the one who books in a full form, then the others as one compact roster, a row per guest: a larger party where only names (or a meal choice) are needed of the rest.
  • Party details per person: a card per guest, the one who books first with every field, the others with theirs, each added or removed in place beside the booking’s summary: a small party whose guests each need a few details.
  • Past lookbooks covers grid: past lookbooks as a grid of covers with their season and status: the archive of a brand that has history.
  • Payment explainer numbered rows: a trust section of the shop: what we see, what we keep, what cannot leak, as numbered rows.
  • Payment methods radio accordion: several unlike methods (card, PayPal, transfer): each a row that opens only its own fields.
  • Payment methods wallets then card: the shop takes wallets: express buttons first, a divider, then a card panel that can fold.
  • Payment recovery actions list: a page of its own after a declined or failed payment: what happened, then up to three ways forward as stacked rows.
  • Payment recovery inline banner: a compact banner above the payment form when recovery happens in place: it takes the focus so the message is read.

All 409 storefront blocks