Embedding Methods
Cal.com offers three primary embedding methods to suit different use cases:Inline Embedding
Embed the calendar directly within your page flow. The booking interface appears as part of your page content.Modal Embedding
Open the calendar in a modal dialog overlay. The modal can be triggered by user actions like button clicks.Floating Button
Add a persistent floating action button that opens the calendar in a modal when clicked.Implementation Options
Depending on your tech stack, you can implement Cal.com embeds using:Vanilla JavaScript Snippet
Use the vanilla JS snippet for quick integration on any website
React Component
Use the React package for seamless integration in React applications
Key Features
Namespace Support
Multiple embeds can coexist on the same page using namespaces, ensuring they don’t interfere with each other:Event System
Listen to booking events to integrate with your application:Prefilling Data
Pre-fill form fields with user information:Theme and Styling
Customize the appearance to match your brand:Performance Optimization
Prerendering
The embed system supports prerendering to optimize initial load times:Iframe Reuse
When reopening a modal, the embed system intelligently reuses the existing iframe when possible, providing a lightning-fast experience.Architecture
The embed system consists of three packages:- @calcom/embed-core - Core library in vanilla JS that manages the embed
- @calcom/embed-snippet - Lightweight snippet that loads embed-core
- @calcom/embed-react - React component wrapper
Communication System
The parent page and embedded iframe communicate using a message-based system with namespaced events to ensure multiple embeds don’t interfere with each other.Instruction Queue
Commands are queued before the iframe is ready and executed once the connection is established, ensuring no commands are lost during initialization.Getting Started
Choose your implementation method:JavaScript Snippet
Quick start with vanilla JavaScript
React Integration
React component with TypeScript support
Customization Options
Theme, styles, and configuration options
Debugging
Enable logging by addingcal.embed.logging=1 as a query parameter:
Next Steps
Choose your implementation
Select between the vanilla JS snippet or React component based on your stack