Skip to content

Commit 3d713ef

Browse files
jontiritilliclaude
andcommitted
docs: add usage, props, and resize explanation to DomoEmbed snippet
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a403999 commit 3d713ef

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

snippets/DomoEmbed.mdx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
{/*
2+
DomoEmbed — reusable component for embedding Domo-hosted content in MDX pages.
3+
4+
USAGE
5+
-----
6+
Import and drop into any MDX page:
7+
8+
import { DomoEmbed } from "/snippets/DomoEmbed.mdx";
9+
10+
<DomoEmbed
11+
src="https://embed.domo.com/embed/pages/XXXXX"
12+
width="100%"
13+
initialHeight="600"
14+
/>
15+
16+
PROPS
17+
-----
18+
src (required) — The Domo embed URL (cards or pages endpoint).
19+
width (optional) — CSS width of the iframe. Defaults to "100%".
20+
initialHeight (optional) — Starting height in pixels before auto-resize fires. Defaults to "600".
21+
22+
AUTO-RESIZE
23+
-----------
24+
Domo's embed runtime sends a postMessage event containing the rendered page height.
25+
This component listens for that message and updates the iframe height automatically,
26+
eliminating scroll traps and double scrollbars. A 15px buffer is added to account
27+
for sub-pixel rounding and scrollbar gutter width.
28+
29+
For the underlying mechanism and plain-HTML equivalents, see:
30+
/portal/embed/embed-in-sites-and-apps/dynamic-iframe-height
31+
32+
NOTE: The embed URL must come from a Domo instance that allows embedding on this domain.
33+
If the iframe appears blank, check the source instance's CSP / embed allowlist settings.
34+
*/}
35+
136
import { useEffect, useRef } from "react";
237

338
export const DomoEmbed = ({ src, width = "100%", initialHeight = "600" }) => {

0 commit comments

Comments
 (0)