Skip to content

Commit f26b361

Browse files
docs: add closeModal() API documentation for embed instructions
- Add comprehensive closeModal() documentation to embed-instructions.mdx - Include usage examples for both namespaced and non-namespaced embeds - Add common use case example in embed-events.mdx - Document supported embed types and error handling - Include migration note from internal API Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
1 parent 81008f3 commit f26b361

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

embedding/embed-instructions.mdx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,25 @@ To open cal link on some action, make it pop open instantly by using `preload`.
3939
</script>
4040
```
4141

42-
- `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
42+
- `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
43+
44+
#### Close modal
45+
46+
Programmatically closes a modal-based embed shown as a pop-up (for example, when opened via an element click or the floating button).
47+
48+
```js
49+
<script>
50+
Cal("closeModal");
51+
</script>
52+
```
53+
54+
**Supported embed types:**
55+
- Pop-up via element click
56+
- Floating button pop-up
57+
58+
**Namespaced usage:**
59+
```js
60+
<script>
61+
Cal.ns.yournamespace("closeModal");
62+
</script>
63+
```

0 commit comments

Comments
 (0)