IFrame

A flexible iframe component with support for URL or port-based sources.

Preview

Installation

Usage

Examples

With URL

With Port

Use the port prop to connect to a local development server running on a specific port.

Helper Function

The component also exports a createIFrameRoute helper function for creating route components.

API Reference

PropTypeDefaultDescription
titlestring-Required title for the iframe (for accessibility)
urlstring-URL to load in the iframe
portnumber-Local port number (constructs URL from current hostname)

Notes

  • Either url or port should be provided
  • If port is used, the iframe will load from the current hostname on that port
  • The iframe includes clipboard-read and clipboard-write permissions
  • The component fills its parent container (100% width and height)