Embed
Embed provides a responsive container for iframes with configurable aspect ratios. The iframe is absolutely positioned to fill the container.
Basic Usage
import { Embed } from "@paramanu/data-display-react"
export default function App() {return <Embed ratio="16/9" src="https://example.com" title="Example" />}<div class="pm-embed pm-embed--16-9"><iframe class="pm-embed__iframe" src="https://example.com" title="Example"></iframe></div>Accessibility
- Always provide a
titleattribute on the iframe for screen readers.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
ratio | "1/1" | "4/3" | "16/9" | "21/9" | "16/9" | Aspect ratio |
fullWidth | boolean | false | Stretches to fill parent width |