Skip to content
Docs

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.

Live example, running against the demo host.

Loading the widget…

<script src="https://devalender.com/widget.js"></script>
<devalender-booking
  handle="ada"
  event="intro-call"
  accent="#7c3aed"
></devalender-booking>

Attributes

AttributeTypeDefaultDescription
handlestring-The host handle, the part after devalender.com/. Required unless team is set.
teamstring-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.
accenthex colour#2563ebColour for buttons and selection, like #7c3aed. In dark theme the widget derives a lighter link colour from it.
theme"light" | "dark"lightColour scheme of the widget.
api-urlURLhttps://devalender.com/apiAPI base URL. Defaults to the origin that served widget.js, then devalender.com.
web-originURLorigin of api-urlOrigin 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.

EventWhendetail
devalender:bookedAn 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.
  • accent sets 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 handle and event are 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-src and connect-src for devalender.com. See frameworks and CSP.