Code sample install band — Product tour block

Pro

product-tour-code-sample-install-band · for landing, app pages

Code sample install band

A focused command panel followed by capability chips; the merchant’s own only.

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/product-tour-code-sample-install-band

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import ProductTourCodeSampleInstallBand from '@/components/trame/blocks/product-tour/product-tour-code-sample-install-band.vue'

const props = {
title: "Code you can actually read",
intro: "Self-contained JavaScript examples; no imaginary service or SDK.",
code: {
filename: "configuration.js",
language: "JavaScript",
source: "const settings = JSON.parse('{\"language\":\"en\"}');\nconsole.log(settings.language);"
},
cta: {
label: "Read the docs",
action: "docs"
},
items: [
{
name: "Read a configuration",
text: "Parse a JSON document in JavaScript.",
snippet: "const settings = JSON.parse('{\"language\":\"en\"}');",
badge: "JavaScript"
},
{
name: "Access a value",
text: "Read the language from the configuration.",
snippet: "const language = settings.language;",
badge: "JavaScript"
}
]
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe section’s heading
introstringWordsa sentence or two under the heading
code*Codethe code sample shown
items*Item[]the items shown, in order
ctaCtathe call to action: its words and the page action it runs
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Code code · 3 props
PropTypeDescription
languagestringDesignthe code’s language, e.g. "ts"
source*stringWordsthe code itself
filenamestringWordsthe file’s name shown above the code
Item items[] · 5 props
PropTypeDescription
name*stringWordsthe item’s name
textstringWordsthe item’s text
badgestringWordsa short tag on the item, e.g. "New"
snippetstringWordsa short code snippet for the item
payloadstringWordsan example payload for the item
Cta cta · 2 props
PropTypeDescription
label*stringWordsthe words on the button or link
action*stringActiona named action of the page
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
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: cta

A product tour section, for landing, app pages; it uses @lucide/vue, class-variance-authority, clsx, reka-ui, tailwind-merge.

More product tour blocks

  • Agent replay beside: the heading on one side, the card on the other: a section between two wide ones, or a heading long enough to read beside the scene.
  • Agent replay card: the heading centred above one conversation card: a landing section that shows what the assistant does, on its own.
  • Before after: two screens or two states side by side, the old one quiet and the new one framed: a redesign or a change of routine — the merchant’s own only.
  • Cards: the same product seen by 2 to 4 kinds of visitor, each with its own picture and the page it leads to — the merchant’s own only.
  • Code change diff panel: An explanation beside static, escaped added and removed code lines; the merchant’s own only.
  • Code tabs cards picker: three or four named recipes: small cards in a row above one wide code panel, the chosen card outlined; the merchant’s own code only.
  • Code tabs file tree: a small project of several files: a folder tree beside the open file, like an editor; the merchant’s own code only.
  • Code tabs list and code: several distinct use cases, each with a line of explanation: the list at the left, the chosen one’s code at the right; the merchant’s own code only.

All 20 product tour blocks