Appointment practitioner first — Booking block

Free

booking-appointment-practitioner-first · for home, landing, service pages

Appointment practitioner first

Clients who book a person rather than a treatment (hairdresser, therapist, coach): choose who first, the services and slots follow

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-appointment-practitioner-first

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import BookingAppointmentPractitionerFirst from '@/components/trame/blocks/booking/booking-appointment-practitioner-first.vue'

const props = {
title: "Book an appointment",
intro: "Pick your service, your stylist and a time slot. We’ll confirm by email.",
services: [
{
id: "coupe",
name: "Cut & blow-dry",
description: "Shampoo, a cut tailored to you, and styling.",
duration: "1 hr",
price: 5500,
from: true
},
{
id: "couleur",
name: "Root color",
description: "A tone-on-tone color with a strengthening treatment.",
duration: "1 hr 30 min",
price: 6800,
from: true
}
],
practitioners: [
{
id: "ines",
name: "Ivy",
role: "Hairstylist and colorist",
serviceIds: [
"coupe",
"couleur"
]
},
{
id: "malo",
name: "Malo",
role: "Hairstylist",
serviceIds: [
"coupe",
"soin"
]
}
],
days: [
{
id: "d14",
weekday: "Tue",
day: "14",
month: "Oct",
label: "Tuesday, October 14",
slots: [
{
id: "d14-0",
time: "9:00 AM",
practitionerId: "ines"
},
{
id: "d14-1",
time: "10:30 AM",
practitionerId: "ines"
}
]
},
{
id: "d15",
weekday: "Wed",
day: "15",
month: "Oct",
label: "Wednesday, October 15",
slots: [
{
id: "d15-0",
time: "9:30 AM",
practitionerId: "malo"
},
{
id: "d15-1",
time: "10:00 AM",
practitionerId: "ines"
}
]
}
],
action: {
label: "Confirm appointment",
action: "appointment.book"
},
options: {
eyebrow: "Online booking",
note: "Free cancellation up to 24 hours before your appointment.",
notesField: true
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordswhat the visitor does ("Book an appointment")
introstringWordsa sentence on how it works: confirmation, changes, cancellation
services*Service[]the services that can be booked
practitionersPractitioner[]the people the visitor may book with
days*Day[]the days offered, a week or two, with their free slots
fieldsField[]the trade’s own questions, the merchant’s words: one to three, asked with the contact details (a vehicle for a garage, an animal for a vet, the job’s address for a plumber)
action*Actionthe call to action: its words and the page action it runs
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Service services[] · 6 props
PropTypeDescription
id*stringDesignthe service’s id, posted with the booking
name*stringWordsthe service ("Cut & blow-dry")
descriptionstringWordswhat it includes, in a sentence
durationstringWordshow long, as the merchant writes it ("1 h")
pricenumberthe price in cents
frombooleanthe price is a starting price
Practitioner practitioners[] · 6 props
PropTypeDescription
id*stringDesignthe person’s id, posted with the booking
name*stringWordsthe practitioner’s name
rolestringWordswhat they do ("Colourist")
avatarstringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the picture shows
serviceIdsstring[]Designthe services they offer; all of them when absent
Day days[] · 6 props
PropTypeDescription
id*stringDesignthe day’s key
weekday*stringWords"Mon."
day*stringWordsthe number, "14"
monthstringWords"Oct."
label*stringWordsthe day in full ("Monday 14 October"), read in the summary
slots*Slot[]the free times of the day, the merchant’s own
Slot days[].slots[] · 3 props
PropTypeDescription
id*stringDesignthe slot’s id, posted with the booking
time*stringWordsthe start, as shown ("14:30")
practitionerIdstringDesignwho is free then; anyone when absent
Field fields[] · 5 props
PropTypeDescription
name*stringDesignthe name the answer is posted under, e.g. "vehicle"; never one of the form’s own names (service, practitioner, day, slot, name, email, phone, notes)
label*stringWordsthe question, as the trade asks it ("Vehicle (model, plate)")
hintstringWordsan example shown in the empty field ("Ford Focus, AB12 CDE")
longbooleanthe answer takes several lines (a text area) rather than one
requiredbooleanthe visitor must answer it to book
Action action · 2 props
PropTypeDescription
label*stringWordsthe confirm button ("Confirm the appointment")
action*stringActionthe page action that receives the booking (posted as a form: service, practitioner when there are practitioners ("any" for no preference), day (days[].id), slot (days[].slots[].id), then each of fields[].name, name, email, phone, and notes when options.notesField)
Options options · 5 props
PropTypeDescription
eyebrowstringWordsa small line above the heading
notestringWordsthe policy, under the button ("Free cancellation up to 24 h before.")
anyLabelstringWordsthe "no preference" choice ("No preference")
notesFieldbooleanshow a free-text field for the visitor’s requests (allergies, wishes), posted as "notes"; absent by default
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
moneyformats a price, given in cents
asseta picture’s address as your app serves it
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 home, landing, service pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.

More booking blocks

  • Availability engagement table: An offer ledger with status and next start, the merchant's own dates only.
  • Availability quarter cards: Period cards with supplied capacity bars, the merchant's own slots only.
  • 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.
  • Curriculum accordion: a long programme read module by module: real disclosures, the first open, what you will learn and the teacher beside.

All 25 booking blocks