Curriculum accordion — Booking block
Probooking-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-accordionUsage
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.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe course’s name or promise ("Learn hand sewing") |
| lead | string | Wordsone or two sentences on who the course is for, as the teacher says it |
| modules* | Module[] | the course’s modules, in order |
| outcomes | string[] | Wordsone thing the student will be able to do |
| teacher | Teacher | who teaches the course |
| action | Action | 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 |
Module modules[] · 3 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe module’s name |
| summary | string | Wordswhat the module covers, in a sentence |
| lessons* | Lesson[] | the module’s lessons, in order |
Lesson modules[].lessons[] · 4 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe lesson’s name |
| duration | string | Wordsits length as the teacher states it ("12 min") |
| kind | 'video' | 'reading' | 'exercise' | what the lesson is |
| preview | boolean | the lesson can be watched without enrolling |
Teacher teacher · 5 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe teacher’s name |
| role | string | Wordswhat they do ("Leatherworker, twenty years at the bench") |
| bio | string | Wordsa few lines of presentation, in their words |
| image | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the picture shows |
Action action · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Sign up for the class") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens (the course), if any |
Options options · 3 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsthe kind of course ("Online course") |
| facts | string[] | Wordsa fact the teacher states about the course ("6 h of video", "Lifetime access") |
| 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:
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.