Fulfilment estimator inline — Storefront block

Pro

storefront-fulfilment-estimator-inline · for product, cart pages

Fulfilment estimator inline

A compact line under the price: a postcode field and the cheapest answer, for a product page that must stay short

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-fulfilment-estimator-inline

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontFulfilmentEstimatorInline from '@/components/trame/blocks/storefront/storefront-fulfilment-estimator-inline.vue'

const props = {
title: "When will my order arrive?",
action: "shipping.estimate",
placeholder: "75011",
options: {
hint: "5 digits",
pickup: {
label: "In-store pickup",
action: "pickup"
}
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe question answered ("When will it be delivered?")
action*stringActionthe page action that estimates (posted by the form, field "postalCode")
resultResultDatathe answer of the shipping tool, absent before any check
placeholderstringWordsan example of the format ("75011")
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Result result · 4 props
PropTypeDescription
postalCode*stringthe postcode that was checked, kept in the field
errorstringwhy the postcode is not valid
unavailablebooleanthe merchant does not deliver there
optionsOption[]the shipping options of the merchant’s own rules for this postcode
Option result.options[] · 5 props
PropTypeDescription
id*string | numberthe option’s id
label*stringthe carrier or mode ("Pickup point", "Express")
eta*stringthe delay as the merchant’s rule words it ("Delivered within 2 to 3 working days"): never computed by the block
price*numberthe price in cents, 0 for free
cutoffstringthe real cut-off the shipping tool returns ("Order before 3 pm, shipped the same day")
Options options · 6 props
PropTypeDescription
labelstringWordsthe field’s label ("Postcode")
hintstringWordshow to type it ("5 digits")
submitLabelstringWordswhat the button does ("Verify")
noServiceTextstringWordswhat is said when the merchant does not deliver there
pickupPickupthe pickup action: its words and the page action it runs
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa band of the page that redefines the theme surfaces inside it
Pickup options.pickup · 2 props
PropTypeDescription
label*stringWords"Pickup in store"
action*stringActiona named action of the page
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
moneyformats a price, given in cents
Linkyour router’s link component
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
  • Subtle motion: one short reveal; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: action, options.pickup
  • Reads shipping_options from your app

A storefront section, for product, cart 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

  • Fit by size tabs: a size at a time: a row of size chips, and under it that size’s measurements and the models who wear it, to picture it before choosing.
  • Fit models cards: clothes worn by real people: height, measurements and the size each one wears, to compare with oneself.
  • Floating products staggered: two staggered columns of tall cards whose pictures drift at opposite paces as the page scrolls: an editorial run of 4 to 12 products; the merchant’s own products and figures only.
  • Fulfilment choice cards: a product that can be delivered or picked up: a switch and the stores with their distance and stock.
  • Garment cuts columns: a range with several cuts (slim, regular, relaxed): the ease of each, side by side.
  • Gift amount guide amounts: the merchant wants to say what each amount buys: one column per amount, drawn from the real catalogue.
  • Gift budgets by budget: price bands as large tiles, each opening its shelf: a visitor who starts from what they want to spend.
  • Gift card balance: a customer holds a card and wants to know what is left on it.

All 409 storefront blocks