Availability timezone bars — Booking block

Pro

booking-availability-timezone-bars · for contact, about pages

Availability timezone bars

Working-hour rows on a shared day axis, the merchant's own hours and timezone labels 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/booking-availability-timezone-bars

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import BookingAvailabilityTimezoneBars from '@/components/trame/blocks/booking/booking-availability-timezone-bars.vue'

const props = {
title: "Let’s take the time to plan your project",
slots: [
{
id: "creation",
period: "Custom work",
state: "Ask us",
response: "The timeline takes shape after a first conversation."
},
{
id: "restauration",
period: "Restoration",
state: "By appointment",
response: "Bring photographs of your piece."
}
],
cta: {
label: "Talk about the project",
action: "contact"
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe section’s heading
slots*Slot[]Datathe periods and how much is still available in each
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
Slot slots[] · 10 props
PropTypeDescription
id*stringDatathe slot’s id
period*stringWordsthe period, e.g. "This week"
state*stringWordswhere it stands, in the merchant’s words, e.g. "Two places left"
nextstringWordswhen the next opening is, as the merchant writes it
remainingnumberhow many places are still free
capacitynumberhow many places the period holds in all
responsestringWordshow fast the merchant answers in this period, e.g. "Reply within 24 h"
hoursstringWordsits hours, as the merchant writes them
startHournumberthe hour it starts, 0 to 24
endHournumberthe hour it ends, 0 to 24
Cta cta · 3 props
PropTypeDescription
label*stringWordsthe words on the button or link
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action applies to, passed to the host with it, if any
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
  • No motion; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: cta
  • Reads slots from your app

A booking section, for contact, about pages; it uses class-variance-authority, clsx, reka-ui, tailwind-merge.

More booking blocks

  • Appointment one page: a small salon with a short list: everything on one page and the summary always in view.
  • Appointment practitioner first: clients who book a person rather than a treatment (hairdresser, therapist, coach): choose who first, the services and slots follow.
  • Appointment steps: a visitor on a phone, or a long list of services: one question at a time, from service to contact.
  • 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.
  • Curriculum columns: a short programme seen at a glance: every module as a card with its lessons visible.

All 25 booking blocks