chore: moved docs into mintlify (#18536)

This commit is contained in:
Peer Richelsen authored and GitHub committed 2025-01-08 23:01:53 +01:00
1 parent 9b2161cc19
commit eba335c903
120 files changed
+2294 -90

No files matched your search

+53
View File
@@ -0,0 +1,53 @@
---
title: Adding embed to your webpage
---
You can get the embed snippet, to install on your webpage, from the Embed Snippet Generator, within the app.
<Note> The snippets provided are automatically updated as per the cal.com instance. **So, even when self hosting, you can simply copy and paste the snippets from there </Note>.
There are three ways in which you can embed your cal.com link to your webpage.
<img src="//images/i1600x900-APQPQxcN1aZt_m0casf.png" alt="Embed options overview" />
## Inline
Show the embed inline anywhere on the webpage. It let's you show the embed at a particular place in your webpage.
[CodeSandbox link[React]](https://codesandbox.io/s/inline-demo-react-for-docs-xps99g?file=/src/App.js)
[CodeSandbox link[HTML]](https://codesandbox.io/s/vanillajs-week-view-inline-y9wgxc?file=/index.html)
<Frame>
<img src="/images/i1600x900-RDSMehJ8vTwZ_zcals5.png" alt="Inline embed example" />
</Frame>
## Pop-up via element click
Show the embed, on click of any element on your webpage, in a popup
[CodeSandbox link[React]](https://codesandbox.io/s/element-click-popup-h5c5v2?file=/public/index.html)
[CodeSandbox link[HTML]](https://codesandbox.io/s/popup-on-click-of-an-existing-element-framework-agnostic-forked-7pl95c?file=/index.html)
<Frame>
<img src="/images/i1600x900-IQ6S7Rq9d94T_d5vl8m.png" alt="Pop-up embed example" />
</Frame>
## Floating button pop-up
Adds a floating button that can be customized and on clicking that the embed shows up in a popup.
[CodeSandbox link[React]](https://codesandbox.io/s/floating-button-popup-react-forked-9y5g95?file=/public/index.html)
[CodeSandbox link[HTML]](https://codesandbox.io/s/embed-floating-button-popup-framework-agnostic-mg7339?file=/src/index.js)
<Frame>
<img src="//images/i1600x900-PNSh9u2m_QV2_v80gvk.png" alt="Floating button embed example" />
</Frame>
## What can you embed?
- You can embed your cal.com link for an event type e.g. `rick/get-rick-rolled`. You can get the snippet from the event-type page.
- You can embed your profile page e.g. rick. For this, you can just update the snippet to replace your cal.com event type link with your username. e.g. `rick/get-rick-rolled => rick`
- You can embed your Routing Form e.g. `forms/YOUR_FORM_ID`. You can get the snippet for that from the Routing Form page.
<Frame>
<img src="//images/i1600x900-iihnWwzsuARg_llvldw.png" alt="Routing form embed example" />
</Frame>
+11
View File
@@ -0,0 +1,11 @@
---
title: Adding slots to your email
---
You can add the slots to your email as well using `Email Embed`. When composing an email, this method of embedding streamlines the process, allowing you to effortlessly share available time slots with recipients.
This ensures seamless scheduling and improved communication efficiency.
<img src="//images/i1600x900-z2MekYaA6oWf_nzivcl.png" alt="Email embed interface" />
<img src="//images/i1600x900-CYkkzVSEXUuc_epdmrm.png" alt="Email embed example" />
+38
View File
@@ -0,0 +1,38 @@
---
title: Embed Events
---
## Actions
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.
```js
<script>
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;
}
})
</script>
```
## Following are the list of supported actions.
| Action | Description | Properties |
|--------|-------------|------------|
| eventTypeSelected | When user chooses an event-type from the listing. | eventType:object // Event Type that has been selected |
| bookingSuccessful | When the booking is successfully done. It might not be confirmed. | confirmed: boolean; //Whether confirmation from organizer is pending or not<br/>eventType: "Object for Event Type that has been booked"<br/>date: string; // Date of Event<br/>duration: number; //Duration of booked Event<br/>organizer: object //Organizer details like name, timezone, email |
| linkReady | Tells that the link is ready to be shown now. | None |
| linkFailed | Fired if link fails to load | code: number; // Error Code<br/>msg: string; //Human Readable msg<br/>data: object // More details to debug the error |
| __iframeReady | It is fired when the embedded iframe is ready to communicate with parent snippet. This is mostly for internal use by Embed Snippet | None |
| __windowLoadComplete | Tells that window load for iframe is complete | None |
| __dimensionChanged | Tells that dimensions of the content inside the iframe changed. | iframeWidth:number, iframeHeight:number |
<Note>
Actions that start with `__` are internal.
</Note>
To get more details on how Embed actually works, you can refer to this [Embed Flowchart](https://www.figma.com/file/zZ5oaUpg12Fuu5mGZrPlP5/Embed-Flowchart).
+42
View File
@@ -0,0 +1,42 @@
---
title: Embed instructions
---
An instruction is how you configure the embed. These instructions can be added immediately after the embed snippet.
An instruction is technically a function with the same name, that would be called with the given arguments.
You would not normally need to learn about these instructions in detail, as the **Embed Snippet Generator** automatically updates the snippet with these instructions in the way you configure it but still they could be useful.
#### Inline
Appends embed `inline` as the child of the element.
```js
<script>
Cal("inline", { elementOrSelector, calLink });
</script>
```
- `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 https://cal.com/john. It makes it easy to configure the calendar host once and use as many links you want with just usernames
#### UI
Configure `ui` for embed. Make it look part of your webpage.
```js
<script>
Cal("ui", { styles });
</script>
```
- `styles` - It supports styling for body and eventTypeListItem. Right now we support just background on these two.
#### Preload
To open cal link on some action, make it pop open instantly by using `preload`.
```js
<script>
Cal("preload", { calLink });
</script>
```
- `calLink` - Cal Link that you want to embed e.g. john. Just give the username. No need to give the full URL https://cal.com/john
@@ -0,0 +1,37 @@
---
title: Getting Embed Code Snippets
---
You can get code snippets for **React** or **HTML** and also configure many different aspects of embeds using the **Embed Snippet Generator**. The code snippet is automatically updated with the changes you make in it.
Here is how you can access it.
1. Click on three dots of the event type and click on the option `Embed`
<img src="//images/i1600x900-h7erbVhGt9X5_uth9oa.png" alt="Accessing embed option" />
2. Configure as you require and then
a. Copy the HTML code snippet
<img src="//images/i1600x900-mdLN0kkooRVB_juid5h.png" alt="Copy HTML code snippet" />
or,
b. Copy the React code snippet
<img src="//images/i1600x900-pDo66wyQ4Zxc_zmljxo.png" alt="Copy React code snippet" />
### What can you configure
- Size of embed
- Theme
- Toggle event type details
- Brand color
- Layout
- Floating button text
- Floating button position at the bottom
<img src="//images/i1600x900-LOniVJNguQth_oibmdv.png" alt="Configuration options" />
You can also configure all the custom CSS variables supported by cal.com app. [Here is a list of all the supported CSS variables](https://github.com/calcom/cal.com/blob/main/packages/config/tailwind-preset.js#L18).
Also, [here is the codeSandbox demo](https://codesandbox.io/s/embed-advanced-css-vars-x2sdgy?file=/src/App.tsx) for a configuration where the look and feel of the embed is changed.
<img src="//images/i1600x900-6CcRzVIWmCTJ_dnnrqu.png" alt="Advanced CSS configuration example" />
@@ -0,0 +1,96 @@
---
title: Prefill booking form in Embed
---
Booking form inside an embed can be prefilled as well.
## Inline Embed
```js
// Prefill Name, Email and Attendee Address - React.
// You can specify config property to do prefilling
// React Demo Link - https://codesandbox.io/s/react-prefill-attendee-address-email-sqhf7r
<Cal
// .... other props in here
config={{
name: "Name",
email: "[email protected]",
location: JSON.stringify({
value: "attendeeInPerson",
// It can be any string that defines an address where the meeting would occur
optionValue: "New York"
})
}}
></Cal>
```
```js
// Prefill Name, Email and Attendee Address - Vanilla JS
// You can use 'inline' instruction to do the prefill
// VanillaJS Demo link - https://codesandbox.io/s/prefill-embed-fields-vanilla-js-zft44w?file=/index.html
Cal("inline", {
config: {
name: "Name",
email: "[email protected]",
location: JSON.stringify({
value: "attendeeInPerson",
// It can be any string that defines an address where the meeting would occur
optionValue: "New York"
})
}
});
```
```js
// Prefill Name, Email and Attendee Phonenumber - React
<Cal
// .... other props in here
config={{
name: "Name",
email: "[email protected]",
location: JSON.stringify({
value: "phone",
// Any valid phonenumber in here
optionValue: "+919999999999"
})
}}
></Cal>
```
```js
// Prefill Name, Email and Attendee Phone - Vanilla JS
// You can use 'inline' instruction to do the prefill
Cal("inline", {
config: {
name: "Name",
email: "[email protected]",
location: JSON.stringify({
value: "phone",
// Any valid phonenumber in here
optionValue: "+919999999999"
})
}
});
```
## Floating button popup
```js
// Prefill Name, Email and Attendee Phone - Vanilla JS
// You can use 'floatingButton' instruction to do the prefill
// This is common for React and VanillaJS embeds.
// Note that for React, Cal is not Cal component here it is Cal API.
Cal("floatingButton", {
config: {
name: "Name",
email: "[email protected]",
location: JSON.stringify({
value: "phone",
// Any valid phonenumber in here
optionValue: "+919999999999"
})
}
});
```
Other location types and other fields can be prefilled in the similar way. You can find the correct value to give from [here](https://cal.com/docs/core-features/bookings/prefill-fields#fields-with-multiple-values)