Simple appointment booking widget with a step-by-step wizard. Pick a service, choose a date from the calendar, select a time, fill in your details, and confirm. Zero dependencies.
npm install handonweb-booking-widgetOr include directly:
<link rel="stylesheet" href="booking-widget.css">
<script src="index.js"></script>const BookingWidget = require('handonweb-booking-widget');
const booking = new BookingWidget({
container: document.getElementById('booking'),
services: [
{ name: 'Free Consultation', duration: 30, price: 0 },
{ name: 'Chatbot Setup', duration: 60, price: 500 }
],
availableSlots: {
'2026-03-10': ['09:00', '10:00', '11:00', '14:00'],
'2026-03-11': ['10:00', '13:00', '15:00']
},
webhookUrl: 'https://your-webhook.com/booking'
});The widget walks users through 5 steps:
- Pick a service — shows all available services with duration and price
- Pick a date — calendar with available dates highlighted
- Pick a time — shows open time slots for the selected date
- Enter details — name, email, phone number
- Confirm — review everything and submit
When confirmed, the booking data is sent as a POST request to your webhook URL (or passed to the onBook callback).
| Option | Type | Default | Description |
|---|---|---|---|
container |
HTMLElement | required | DOM element to render into |
services |
Array | required | Service list: { name, duration, price } |
availableSlots |
Object | required | Slots by date: { "YYYY-MM-DD": ["HH:MM"] } |
webhookUrl |
string | null | URL to POST booking data to |
onBook |
Function | null | Callback receiving booking data |
theme |
Object | {} | Colour overrides: { primary } |
{
"service": "Chatbot Setup",
"duration": 60,
"price": 500,
"date": "2026-03-10",
"time": "10:00",
"name": "John Smith",
"email": "john@example.com",
"phone": "+44 7700 900000",
"bookedAt": "2026-03-09T14:30:00.000Z"
}booking.reset()— Go back to step 1 and clear all selectionsbooking.destroy()— Remove the widget from the DOM
Include booking-widget.css for the default styles. Use the theme.primary option to change the accent colour, or override these classes:
.bw-container— outer wrapper.bw-service-card— service selection cards.bw-cal-available— available calendar dates.bw-time-slot— time slot buttons.bw-btn-primary— primary action button
We build AI chatbots, voice agents, and automation tools for businesses.
- 🌐 handonweb.com
- 📧 outreach@handonweb.com
- 📍 Chester, UK
MIT