Set up your embed

Display types

Assuming that you have followed the steps of installing and initializing the snippet, you can show the embed in the following ways:


Show the embed inline inside a container element. It would take the width and height of the container element.
Cal("inline", {
elementOrSelector: "Your Embed Container Selector Path", // You can also provide an element directly
calLink: "jane", // The link that you want to embed. It would open in embed
config: {
name: "John Doe", // Prefill Name
email: "[email protected]", // Prefill Email
notes: "Test Meeting", // Prefill Notes
guests: ["[email protected]", "[email protected]"], // Prefill Guests
theme: "dark", // "dark" or "light" theme
import Cal from "@calcom/embed-react";
const MyComponent = () => (
name: "John Doe",
notes: "Test Meeting",
guests: ["[email protected]"],
theme: "dark",
To show the embed as a popup on clicking an element, add data-cal-link attribute to the element.
To show the embed as a popup on clicking an element, simply add data-cal-link attribute to the element.
import "@calcom/embed-react";
const MyComponent = ()=> {
return <button data-cal-link="jane" data-cal-config='A valid config JSON'></button>

Supported Instructions

Consider an instruction as a function with that name and that would be called with the given arguments.


Appends embed inline as the child of the element.
Cal("inline", { elementOrSelector, calLink });
  • elementOrSelector - Give it either a valid CSS selector or an HTMLElement instance directly
  • calLink - Cal Link that you want to embed e.g. john. Just give the username. No need to give the full URL It makes it easy to configure the calendar host once and use as many links you want with just usernames


Configure UI for embed. Make it look part of your webpage.
Cal("inline", { styles });
  • styles - It supports styling for body and eventTypeListItem. Right now we support just background on these two.


If you want to open cal link on some action. Make it pop open instantly by preloading it.
Cal("preload", { calLink });
  • calLink - Cal Link that you want to embed e.g. john. Just give the username. No need to give the full URL


You can listen to an action that occurs in embedded cal link as follows. You can think of them as DOM events. We are avoiding the term "events" to not confuse it with Cal Events.
Cal("on", {
action: "ANY_ACTION_NAME",
callback: (e)=>{
// `data` is properties for the event.
// `type` is the name of the action(You can also call it type of the action.) This would be same as "ANY_ACTION_NAME" except when ANY_ACTION_NAME="*" which listens to all the events.
// `namespace` tells you the Cal namespace for which the event is fired/
const {data, type, namespace} = e.detail;

Following are the list of supported actions.

When user chooses an event-type from the listing.
eventType:object // Event Type that has been selected"
When the booking is successfully done. It might not be confirmed.
confirmed: boolean; //Whether confirmation from organizer is pending or not eventType: "Object for Event Type that has been booked"; date: string; // Date of Event duration: number; //Duration of booked Event organizer: object //Organizer details like name, timezone, email
Tells that the link is ready to be shown now.
Fired if link fails to load
code: number; // Error Code msg: string; //Human Readable msg data: object // More details to debug the error
It is fired when the embedded iframe is ready to communicate with parent snippet. This is mostly for internal use by Embed Snippet
Tells that window load for iframe is complete
Tells that dimensions of the content inside the iframe changed.
iframeWidth:number, iframeHeight:number
Actions that start with __ are internal.
To get more details on how Embed actually works, you can refer to this Embed Flowchart


Vanilla Js