Booking widget
<devalender-booking> is the whole booking flow in one element: pick a day and time, enter name and email, confirm. Use it when you want invitees to book without leaving your page. Generate a snippet with the embed builder.
<script src="https://devalender.com/widget.js"></script>
<devalender-booking
handle="ada"
event="intro-call"
accent="#7c3aed"
></devalender-booking>Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
handle | string | - | The host handle, the part after devalender.com/. Required unless team is set. |
team | string | - | The team slug, the part after devalender.com/team/. Books round-robin across the team and takes the place of handle. |
event (required) | string | - | The event type slug. |
accent | hex colour | #2563eb | Colour for buttons and selection, like #7c3aed. In dark theme the widget derives a lighter link colour from it. |
theme | "light" | "dark" | light | Colour scheme of the widget. |
api-url | URL | https://devalender.com/api | API base URL. Defaults to the origin that served widget.js, then devalender.com. |
web-origin | URL | origin of api-url | Origin used for the "Manage or reschedule" and "Powered by" links. |
Attributes can change at runtime. The widget reloads when handle, team or event change.
To book a team event type, set team="acme" instead of handle. Each booking is assigned to a free member. If both are set, team wins.
Events
Events bubble and are composed, so you can listen on document.
| Event | When | detail |
|---|---|---|
devalender:booked | An invitee completed a booking. | booking, timezone |
<script>
document.addEventListener('devalender:booked', (e) => {
console.log(e.detail.booking.id, e.detail.timezone);
});
</script>React
import { DevalenderBooking } from '@devalender/widget/react';
export function Book() {
return (
<DevalenderBooking
handle="ada"
event="intro-call"
accent="#7c3aed"
onBooked={(e) => console.log(e.detail.booking.id)}
/>
);
}The props are the attributes in camelCase (apiUrl), except web-origin, which the React wrapper does not expose, plus an onBooked callback with a typed event.
Theming
theme="dark"switches to a dark surface.accentsets the button and selection colour. In the dark theme the widget derives a lighter link colour from the accent so links keep enough contrast.- The element reads CSS custom properties, so you can also theme it from your stylesheet:
--dvl-accent,--dvl-bg,--dvl-fg,--dvl-muted,--dvl-border,--dvl-radius.
devalender-booking {
--dvl-radius: 4px;
--dvl-border: #d4d4d8;
}Note:
Free plans show a "Powered by devalender" link under the widget. Pro removes it.
Troubleshooting
- Nothing renders. Check
handleandeventare both set and the event type is active. The widget renders nothing without both. - "Unavailable" message. The host's plan does not allow booking right now.
- Blocked in the console. Your Content-Security-Policy needs
script-srcandconnect-srcfor devalender.com. See frameworks and CSP.