@calcom/embed-react package provides a React component and hooks for seamlessly integrating Cal.com into your React applications with full TypeScript support.
Installation
Peer Dependencies
The package requires React 18+ or React 19+:Quick Start
Inline Embed Component
The simplest way to embed Cal.com is using theCal component:
With Configuration
Prefill booking information and customize the appearance:Component Props
TheCal component accepts the following props:
CalProps Interface
Configuration Options (config prop)
Using getCalApi
For more advanced use cases, use thegetCalApi function to interact with the Cal API programmatically:
Basic Usage
With Namespace
Event Handling
Listen to booking events using the event system:Type-Safe Event Handling
Available Events
Customizing UI
Customize the embed appearance dynamically:Modal Embed
Create a modal embed triggered by a button:Floating Button
Add a persistent floating button:Multiple Embeds with Namespaces
Use namespaces to have multiple embeds on the same page:TypeScript Support
The package includes full TypeScript definitions:Custom Embed URL
For self-hosted instances, specify a custom embed URL:Best Practices
Use namespaces for multiple embeds
Use namespaces for multiple embeds
When you have multiple embeds on the same page, always use unique namespaces to prevent conflicts.
Clean up event listeners
Clean up event listeners
Always remove event listeners in the cleanup function to prevent memory leaks.
Handle loading states
Handle loading states
The
getCalApi function is asynchronous. Handle loading states appropriately in your UI.Responsive container
Responsive container
Ensure the container has appropriate dimensions. The embed will fill its container.
Next Steps
Customization
Learn about theme and styling options
JavaScript Snippet
Alternative implementation for non-React apps