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
| Prop | Type | Default | Description |
|---|---|---|---|
title | string | - | Required title for the iframe (for accessibility) |
url | string | - | URL to load in the iframe |
port | number | - | Local port number (constructs URL from current hostname) |
Notes
- Either
urlorportshould be provided - If
portis used, the iframe will load from the current hostname on that port - The iframe includes
clipboard-readandclipboard-writepermissions - The component fills its parent container (100% width and height)