Address check stacked — Storefront block

Pro

storefront-address-check-stacked · for checkout pages

Address check stacked

Stack the two addresses in a narrow checkout column, keeping both choices available.

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-address-check-stacked

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontAddressCheckStacked from '@/components/trame/blocks/storefront/storefront-address-check-stacked.vue'

const props = {
title: "Where should we send your Far Meridian trip pack?",
typed: {
name: "Elena Costa",
line1: "240 Harbor View Ter",
line2: "Apt 5C",
postalCode: "94111",
city: "San Francisco, CA",
country: "United States"
},
suggested: {
name: "Elena Costa",
line1: "240 Harbor View Terrace",
line2: "Apt 5C",
postalCode: "94111",
city: "San Francisco, CA",
country: "United States"
},
note: "Your printed itinerary, luggage tags and maps of the Atlas route ship ten days before departure. Keep what you typed if it describes your address better.",
actions: {
keep: "keep-address",
use: "use-address-suggestion"
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe section’s heading
typed*TypedDatathe address as the customer typed it
suggestedSuggestedDatathe address the checking service suggests, if it has one
notestringWordsa short note under the section
actions*Actionsthe page actions the block runs, each described below
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Typed typed · 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
Suggested suggested · 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
Actions actions · 2 props
PropTypeDescription
keep*stringActionkeeps the address as typed
use*stringActionuses the suggested address
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
  • Asks your app through actions: address.choose, address.choose
  • Reads address_suggestion from your app

A storefront section, for checkout pages; it uses 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

  • Accepted items tiles: what is accepted as picture tiles, the steps in a strip above: a shop that takes back several kinds of items.
  • Accepted methods families: a payments page or a cart: the accepted methods by family, and the refused ones with their reason.
  • 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.
  • 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.
  • Archive figures numbers: Supplied figures and a period chart above the archive entries; the merchant's own measures only.

All 409 storefront blocks