Curriculum accordion — Booking block

Pro

booking-curriculum-accordion · for product, landing, course pages

Curriculum accordion

A long programme read module by module: real disclosures, the first open, what you will learn and the teacher beside

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/booking-curriculum-accordion

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import BookingCurriculumAccordion from '@/components/trame/blocks/booking/booking-curriculum-accordion.vue'

const props = {
title: "Learn hand sewing, from the first stitch to the finished piece",
lead: "A video course for beginners: precise techniques, filmed up close, and exercises to do at home with a little fabric and thread.",
modules: [
{
title: "Thread and needle basics",
summary: "Choosing your tools, threading, tying a secure knot.",
lessons: [
{
title: "Welcome and what you’ll need",
duration: "6 min",
kind: "video",
preview: true
},
{
title: "Choosing your thread and needle",
duration: "11 min",
kind: "video",
preview: true
}
]
},
{
title: "The essential stitches",
summary: "Running stitch, backstitch, whipstitch: when to use which.",
lessons: [
{
title: "The running stitch",
duration: "12 min",
kind: "video"
},
{
title: "The backstitch",
duration: "14 min",
kind: "video"
}
]
}
],
outcomes: [
"Thread, knot and neatly sew the three basic stitches",
"Sew a button back on and hem a pair of pants"
],
teacher: {
name: "Claire Martin",
role: "Workshop seamstress for twenty years",
bio: "She teaches simple techniques you can repeat on your own without having watched them a hundred times.",
image: "https://images.unsplash.com/photo-1586216583179-20b23ef9dd5f?w=800&q=80",
alt: "A craftswoman’s hands cutting black fabric, scissors beside them"
},
action: {
label: "Enroll in the course",
action: "enroll",
record: {
id: "couture-main"
}
},
options: {
eyebrow: "Online course",
facts: [
"Lifetime access",
"Beginners welcome"
]
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe course’s name or promise ("Learn hand sewing")
leadstringWordsone or two sentences on who the course is for, as the teacher says it
modules*Module[]the course’s modules, in order
outcomesstring[]Wordsone thing the student will be able to do
teacherTeacherwho teaches the course
actionActionthe call to action: its words and the page action it runs
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Module modules[] · 3 props
PropTypeDescription
title*stringWordsthe module’s name
summarystringWordswhat the module covers, in a sentence
lessons*Lesson[]the module’s lessons, in order
Lesson modules[].lessons[] · 4 props
PropTypeDescription
title*stringWordsthe lesson’s name
durationstringWordsits length as the teacher states it ("12 min")
kind'video' | 'reading' | 'exercise'what the lesson is
previewbooleanthe lesson can be watched without enrolling
Teacher teacher · 5 props
PropTypeDescription
name*stringWordsthe teacher’s name
rolestringWordswhat they do ("Leatherworker, twenty years at the bench")
biostringWordsa few lines of presentation, in their words
imagestringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the picture shows
Action action · 3 props
PropTypeDescription
label*stringWordswhat happens ("Sign up for the class")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens (the course), if any
Options options · 3 props
PropTypeDescription
eyebrowstringWordsthe kind of course ("Online course")
factsstring[]Wordsa fact the teacher states about the course ("6 h of video", "Lifetime access")
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
asseta picture’s address as your app serves it
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

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

More booking blocks

  • Availability statement: A capacity statement with concise cells, the merchant's own availability only.
  • Availability timezone bars: Working-hour rows on a shared day axis, the merchant's own hours and timezone labels only.
  • Class agenda: the whole week as one scrolling agenda grouped by date, with the studio’s picture: the week told as a story.
  • Class schedule day list: a visitor on a phone, or a few classes a day: one day at a time, each class with room to breathe.
  • Class schedule week grid: a studio with a full week of classes: every day side by side, the rhythm of the week seen at once.
  • Demo split: a B2B landing page’s "book a demo" section: why the call is worth it and who leads it on one side, the booking card (day, time, details) on the other.
  • Demo stacked: a dedicated demo page or the closing section of a long landing page: a centred promise, the points in one ruled row, then a wide booking panel with the days down its side.
  • Room picker cards: rooms as photo cards, the rate picked inside the card: a small hotel with three or four rooms that sell by the picture.

All 25 booking blocks