Party details per person — Storefront block
Prostorefront-party-details-per-person · for checkout pages
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
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-party-details-per-personUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontPartyDetailsPerPerson from '@/components/trame/blocks/storefront/storefront-party-details-per-person.vue'
const props = {
booking: {
id: "trip-bivouac-14jun",
name: "Two-day lake bivouac, guided",
image: "https://images.unsplash.com/photo-1576176539998-0237d1ac6a85?w=1600&q=80",
alt: "Two tents on a meadow facing a mountain lake",
when: "Saturday 14 June, 9:00",
duration: "2 days, 1 night",
place: "Lakeside car park, Glenridding",
unitPrice: 14500
},
party: {
size: 2,
max: 8
},
fields: [
{
key: "firstName",
label: "First name",
required: true,
autocomplete: "given-name"
},
{
key: "lastName",
label: "Last name",
required: true,
autocomplete: "family-name"
}
],
guests: [
{
firstName: "Camille",
lastName: "Renard",
email: "[email protected]"
}
],
action: "checkout.party",
back: {
label: "Back to dates",
action: "checkout.dates"
},
title: "Who is coming?",
note: "Names go on the hut booking and the meal order. We never share them.",
options: {
submitLabel: "Continue to payment"
}
}
</script>
<template>
<StorefrontPartyDetailsPerPerson v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| booking* | Booking | Datathe booking this step is for, from the cart |
| party* | Party | the party’s size and the merchant’s limits |
| fields* | Field[] | the details the merchant needs, in order: only what it really uses |
| guests | Record<string, string>[] | Datathe details already known or entered, one record per guest by field key, the person who books first |
| action* | string | Actionsaves the party: through the host it receives `{ size, guests }`; posted natively the form carries `size` and `g<n>.<key>` per guest. The form is hidden when the page lacks it |
| back | Back | the step before, e.g. "Back to dates" |
| title | string | Wordsthe step’s heading, e.g. "Who is coming?" |
| note | string | Wordswhy the merchant needs these details, in its own words, e.g. "Names go on the hut booking; we never share them" |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Booking booking · 8 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe booked item’s id, posted with the details |
| name* | string | Wordswhat is booked, e.g. "Two-day lake bivouac, guided" |
| image | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the picture shows |
| when | string | Wordsthe date and time booked, as the shop writes it, e.g. "Saturday 14 June, 9:00" |
| duration | string | Wordshow long it lasts, e.g. "2 days, 1 night" |
| place | string | Wordswhere it starts, e.g. "Lakeside car park, Glenridding" |
| unitPrice* | number | the price per person, in cents |
Party party · 3 props
| Prop | Type | Description |
|---|---|---|
| size* | number | how many people are booked now |
| min | number | the fewest people the merchant takes; 1 by default |
| max* | number | the most people one booking takes, as the merchant set it |
Field fields[] · 8 props
| Prop | Type | Description |
|---|---|---|
| key* | string | Designthe field’s name, posted for each guest, e.g. "firstName" |
| label* | string | Wordswhat is asked, e.g. "First name" |
| type | 'text' | 'email' | 'tel' | 'date' | 'select' | the kind of answer: text by default |
| required | boolean | true: the guest must answer it |
| choices | string[] | Wordsthe answers of a select field |
| ask | 'everyone' | 'lead' | who it is asked of: everyone by default, or only the person who books (an email, a phone) |
| autocomplete | string | Designthe browser’s autofill token for the person who books, e.g. "given-name" or "email" |
| help | string | Wordsone short line under the field, e.g. "As written on the passport" |
Back back · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe link’s words, e.g. "See the collection" |
| action | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action applies to, passed to the host with it, if any |
| url | string | Designan address outside the app |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| submitLabel | string | Wordsthe button that moves on, e.g. "Continue to payment" |
| 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 |
| money | formats a price, given in cents |
| asset | a picture’s address as your app serves it |
| Link | your router’s link component |
| 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
- Asks your app through actions:
checkout.party,back - Reads
bookingsfrom your app
A storefront section, for checkout pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More storefront blocks
- Order tracker vertical timeline: the status and window on top, then every event of the carrier’s feed: the default for one parcel.
- Package contents side by side: a product sold as a kit: the specifications and what is in the box, side by side.
- Pairing suggestions cards: Image-led pairing cards for serving suggestions alongside a product; the merchant’s own only.
- Parcel cart by shipment: when the order leaves in several parcels or to several people: one card per delivery with its own heading and arrival, the summary beside.
- 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 instalments plan schedule: the provider offers pay-in-full or N payments: the chosen plan shows its dated schedule and any extra cost.
- Payment methods radio accordion: several unlike methods (card, PayPal, transfer): each a row that opens only its own fields.