File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+
136import { useEffect , useRef } from " react" ;
237
338export const DomoEmbed = ({ src , width = " 100%" , initialHeight = " 600" }) => {
You can’t perform that action at this time.
0 commit comments