HtmlEmbed
Renders raw HTML content directly on the page. Use it for third‑party widgets, custom embeds, Calendly scheduling, Google Forms, social media embeds, custom badges, or any HTML snippet the user needs. Do not use it for videos; choose VideoPlayer instead.
HtmlEmbed
Renders raw HTML content directly on the page. Use it for third‑party widgets, custom embeds, Calendly scheduling, Google Forms, social media embeds, custom badges, or any HTML snippet the user needs. Do not use it for videos; choose VideoPlayer instead.
Use Cases
- Third‑party widget embeds (Calendly, Typeform, HubSpot)
- Social media embeds (Twitter/X posts, Instagram posts, TikTok)
- Custom HTML badges or shields
- Google Maps iframe embeds (when Map component is insufficient)
- Google Forms or other form embeds
- Custom JavaScript widgets
- Payment processor embeds (Stripe, PayPal buttons)
- Live chat widget embeds
- Custom analytics or tracking pixels
Properties
html
Raw HTML content to render. Can include any valid HTML tags, iframes, script tags, or embed codes. Type: string.
customCss
Custom CSS styles for the container. Applies to the outermost wrapper. Type: string.
Best Practices
- Use VideoPlayer for YouTube/Vimeo — it has responsive controls, thumbnails, and lazy loading
- Only use HtmlEmbed when no dedicated component exists for the content type
- Keep HTML minimal and well‑formed
- Test that embedded content is responsive (use width: 100% where possible)
- Third‑party scripts may affect page load performance — use sparingly
Common Mistakes
Using HtmlEmbed for YouTube or Vimeo videos
Why it's a problem: VideoPlayer provides responsive playback, controls, thumbnails, and lazy loading. Raw iframes lack all of this.
Fix: Use page.VideoPlayer({ url: 'https://youtube.com/watch?v=...' }) instead.
Embedding very large HTML blocks
Why it's a problem: Large HTML blocks are hard to maintain and may break the page layout.
Fix: Keep embedded HTML focused and minimal. For complex layouts, use native components.