Accepted methods families — Storefront block

Pro

storefront-accepted-methods-families · for checkout, cart, product pages

Accepted methods families

A payments page or a cart: the accepted methods by family, and the refused ones with their reason

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-accepted-methods-families

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontAcceptedMethodsFamilies from '@/components/trame/blocks/storefront/storefront-accepted-methods-families.vue'

const props = {
title: "Booking a table at Ember & Rye",
intro: "A card holds your seats at the wood-fired counter; you pay for dinner at the table, never before.",
items: [
{
heading: "Why do you hold my card when I book?",
body: "The tasting menu is cooked for a fixed number of guests, so we hold $40 per seat and release it when you dine."
},
{
heading: "When is the hold charged?",
body: "Only if you cancel less than 48 hours before your table, or don’t come at all."
}
],
methods: [
{
group: "Cards",
labels: [
"Visa",
"Mastercard"
],
note: "Held when you book, charged at the table."
},
{
group: "Wallets",
labels: [
"Apple Pay",
"Google Pay"
]
}
]
}
</script>

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

Props

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

PropTypeDescription
title*stringWordswhat the block answers ("How payment works")
introstringWordsone sentence of the merchant’s real payment policy
itemsItem[]2 to 6 claims the merchant can stand behind; each is their own policy
methodsMethod[]the methods the shop really accepts, by family; names, not logos
refusedRefused[]methods the shop does not accept, and why
caveatstringWordsone line of fine print, only if the merchant has one
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Item items[] · 2 props
PropTypeDescription
heading*stringWordsa short question or fact ("When is my card charged?")
body*stringWordsone sentence, the merchant’s real policy ("At shipping, never before.")
Method methods[] · 3 props
PropTypeDescription
group*stringWordsthe family ("Cards")
labels*string[]Wordsa method’s name, in words
notestringWordsone line on the family
Refused refused[] · 2 props
PropTypeDescription
label*stringWordsa method not accepted
reason*stringWordswhy, in a sentence
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
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

A storefront section, for checkout, cart, product pages; it uses @lucide/vue.

More storefront blocks

  • Accepted items tiles: what is accepted as picture tiles, the steps in a strip above: a shop that takes back several kinds of items.
  • Addon picker main and addons: a big main card with checkboxes for the add-ons beside it and the summary under: add-ons that complete one product.
  • Address check side by side: Compare the entered address with a postal service suggestion at equal prominence.
  • Address check stacked: Stack the two addresses in a narrow checkout column, keeping both choices available.
  • Adjusted cart with adjustment: when something besides the lines moves the price (a trade-in credit, import duties): a card explains it in numbered steps above the summary.
  • Advice questions: 3 or 4 yes/no questions, each opening its advice (details, no script): a short questionnaire in the page.
  • Ageing stages row: how a choice ages, in four moments from the first week to the fifth year: a break-in or durability story.
  • Alone or bundle versus: two columns, the product alone and the whole bundle, the bundle larger: a set sold at a real saving.

All 409 storefront blocks