Checkout focused — Navbar block
Pronavbar-checkout-focused · for home, catalog, product, cart, checkout, account, landing pages
Checkout focused
The pages where one pays: no links to wander off, a way back to the cart, the name and the merchant’s own words on paying
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/navbar-checkout-focusedUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import NavbarCheckoutFocused from '@/components/trame/blocks/navbar/navbar-checkout-focused.vue'
const props = {
name: "Ostra",
cart: {
action: "cart",
count: 2
},
assurance: "Secure checkout · Free returns within 30 days"
}
</script>
<template>
<NavbarCheckoutFocused v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe shop’s name, shown when there is no logo |
| logo | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| cart* | Cart | the cart button: where it leads and how many items it holds |
| announcement | string | Wordsa line above the bar, as the merchant wrote it |
| assurance | string | Wordscheckout: what the merchant says about paying here ("Secure payment"), beside the lock |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Cart cart · 6 props
| Prop | Type | Description |
|---|---|---|
| action* | string | Actionthe cart page |
| count* | number | Dataitems in the cart |
| subtotal | number | Datacents |
| lines | Line[] | Datathe cart’s lines, for a preview |
| freeShippingThreshold | number | Datacents the merchant sets for free shipping |
| checkout | string | Actiona named action of the page |
Line cart.lines[] · 8 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| product* | Product | the product on the line |
| variant | string | Wordsthe chosen options, written out ("Navy · 42") |
| unitPrice* | number | an amount in cents |
| compareAt | number | an amount in cents |
| quantity* | number | how many, at least 1 |
| maxQuantity | number | the most the line may hold |
| note | string | Wordsa line note: a gift, a delivery delay |
Product cart.lines[].product · 4 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe product’s name |
| image | string | null | Picturethe main picture; null or absent: the product has none yet |
| alt | string | Wordswhat the main picture shows |
Options options · 3 props
| Prop | Type | Description |
|---|---|---|
| sticky | boolean | 'always' | 'smart' | 'none' | "always" (or true) keeps the bar on screen, "smart" hides it while one scrolls down and brings it back on the way up, "none" (or false, the default) lets it scroll away |
| border | boolean | false: no line under the header |
| 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 |
| 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
- Subtle motion: one short reveal; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
cart,cart.checkout
A navbar section, for home, catalog, product, cart, checkout, account, landing pages; it uses @lucide/vue.
More navbar blocks
- Classic: a marketing site: the name left, the links centred, the action right.
- Floating overlay: a site whose page opens on a full-width photo (commerce.HeroImage "overlay", commerce.HeroSlider "fullbleed", landing.HeroSplit "backdrop") and whose bar needs no cart, account or search: a dark inset pill floating over that hero, the name, the links and one action; not for a shop (use shell.StoreHeader), not for an app (use shell.AppShell or shell.CompactShell), not over a page that starts with text or a light band.
- Floating pill: a landing page or a launch: a rounded bar that floats over the page with one action at its end.
- Mega menu index panel: a deep catalogue, or a brand that wants its name centred: the brand and shortcuts above, the links on a ruled row below, and a link opens an index of every entry in words beside one or two of them as large pictures.
- Mega menu panel: catalogues of three to six categories: a link opens a wide panel of picture cards.
- Menu overlay: a portfolio, a studio or a brand site with few pages and a strong identity: an almost empty bar whose "Menu" opens a full-screen panel of very large links.
- Reorder row: grocery and consumables: a slim second row of what the visitor bought before.
- Spread grid: an editorial or design-led site with 4 or 5 links: a Swiss-grid bar cut into equal columns, the name in the first, one link per column, the action in the last.