Address check side by side — Storefront block
Prostorefront-address-check-side-by-side · for checkout pages
Address check side by side
Compare the entered address with a postal service suggestion at equal prominence.
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-side-by-sideUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontAddressCheckSideBySide from '@/components/trame/blocks/storefront/storefront-address-check-side-by-side.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>
<StorefrontAddressCheckSideBySide v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe section’s heading |
| typed* | Typed | Datathe address as the customer typed it |
| suggested | Suggested | Datathe address the checking service suggests, if it has one |
| note | string | Wordsa short note under the section |
| actions* | Actions | the page actions the block runs, each described below |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Typed typed · 7 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe recipient’s name |
| line1* | string | Wordsstreet and number |
| line2 | string | Wordsa second address line: building, floor |
| postalCode* | string | Wordsthe postcode |
| city* | string | Wordsthe town |
| country* | string | Wordsthe country |
| phone | string | Wordsa phone number for the delivery |
Suggested suggested · 7 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe recipient’s name |
| line1* | string | Wordsstreet and number |
| line2 | string | Wordsa second address line: building, floor |
| postalCode* | string | Wordsthe postcode |
| city* | string | Wordsthe town |
| country* | string | Wordsthe country |
| phone | string | Wordsa phone number for the delivery |
Actions actions · 2 props
| Prop | Type | Description |
|---|---|---|
| keep* | string | Actionkeeps the address as typed |
| use* | string | Actionuses the suggested address |
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
- Asks your app through actions:
address.choose,address.choose - Reads
address_suggestionfrom 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.