Dev showcase steps with code — Product tour block
Proproduct-tour-dev-showcase-steps-with-code · for landing, app pages
Dev showcase steps with code
Ordered instructions with a snippet for each step; 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-dev-showcase-steps-with-codeUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import ProductTourDevShowcaseStepsWithCode from '@/components/trame/blocks/product-tour/product-tour-dev-showcase-steps-with-code.vue'
const props = {
title: "Code you can actually read",
intro: "Self-contained JavaScript examples; no imaginary service or SDK.",
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>
<ProductTourDevShowcaseStepsWithCode 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 |
| intro | string | Wordsa sentence or two under the heading |
| items* | Item[] | the items shown, in order |
| cta | Cta | the call to action: its words and the page action it runs |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Item items[] · 5 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe item’s name |
| text | string | Wordsthe item’s text |
| badge | string | Wordsa short tag on the item, e.g. "New" |
| snippet | string | Wordsa short code snippet for the item |
| payload | string | Wordsan example payload for the item |
Cta cta · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe words on the button or link |
| action* | string | Actiona named action of the page |
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 |
| 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:
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
- 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.
- Code tabs window: one example written in a few languages: a centred code window with the languages as tabs on its top edge; the merchant’s own code only.
- Demo chapters side list: one real video with a chapter list beside its poster; nothing plays until asked: a demo that is worth watching — the merchant’s own only.
- Demo teaser: one framed screen that leans towards the pointer, a chip on it and an action: an invitation to try — the merchant’s own only.
- Line by line rows: one row per line, old and new answers side by side with their values, no boxes: a point-by-point accounting.
- Product demo beside: the product’s live mini-interface on a picture beside an accordion of its sub-features, opening one plays its pointer’s short demo: one feature told through 2 to 5 sub-features, the visitor choosing what to see; figures, names and messages in the mini-interfaces are the merchant’s own only.
- Product demo stacked: the sub-features as a centred tab strip over a wide stage, the open one’s words above its mini-interface: 2 to 4 sub-features of equal weight that need a larger window (a board, a wide list); figures, names and messages in the mini-interfaces are the merchant’s own only.
- Side tabs: 3 to 5 areas of an app or a service, a list of areas beside one framed screen: walk through it screen by screen — the merchant’s own only.