Accepted methods families — Storefront block
Prostorefront-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-familiesUsage
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.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat the block answers ("How payment works") |
| intro | string | Wordsone sentence of the merchant’s real payment policy |
| items | Item[] | 2 to 6 claims the merchant can stand behind; each is their own policy |
| methods | Method[] | the methods the shop really accepts, by family; names, not logos |
| refused | Refused[] | methods the shop does not accept, and why |
| caveat | string | Wordsone line of fine print, only if the merchant has one |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Item items[] · 2 props
| Prop | Type | Description |
|---|---|---|
| heading* | string | Wordsa short question or fact ("When is my card charged?") |
| body* | string | Wordsone sentence, the merchant’s real policy ("At shipping, never before.") |
Method methods[] · 3 props
| Prop | Type | Description |
|---|---|---|
| group* | string | Wordsthe family ("Cards") |
| labels* | string[] | Wordsa method’s name, in words |
| note | string | Wordsone line on the family |
Refused refused[] · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsa method not accepted |
| reason* | string | Wordswhy, in a sentence |
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 |
| 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
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.