{"library":"react-iframe","title":"React Iframe Component","description":"react-iframe is a React component designed to simplify the integration of `<iframe>` elements into React applications. It acts as a convenient, TypeScript-supported wrapper around the native HTML `<iframe>` tag, abstracting common setup and attribute handling. The current stable version is 1.8.5. While it does not follow a strict release cadence, the project appears actively maintained with recent updates and comprehensive TypeScript support, making it well-suited for modern React development. Its key differentiator is providing a prop-driven interface for `iframe` attributes, including graceful handling of HTML5 deprecated attributes (like `frameBorder` and `allowFullScreen`), and offering explicit, convenient props for `sandbox` and `allow` attributes, which are crucial for security and feature control in contemporary web development and can be more cumbersome to manage directly with a plain `<iframe>` element.","language":"javascript","status":"active","last_verified":"Tue Apr 21","install":{"commands":["npm install react-iframe"],"cli":null},"imports":["import Iframe from 'react-iframe'","const Iframe = require('react-iframe').default","import type { IframeProps } from 'react-iframe'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import React from 'react';\nimport Iframe from 'react-iframe';\n\nfunction MyPage() {\n  return (\n    <div>\n      <h1>My Embedded Content</h1>\n      <Iframe \n        url=\"https://www.sdrive.app/embed/1ptBQD\"\n        width=\"640px\"\n        height=\"320px\"\n        id=\"my-sdrive-iframe\"\n        className=\"my-iframe-class\"\n        display=\"block\"\n        position=\"relative\"\n        frameBorder={0}\n        allow=\"fullscreen; camera; microphone; geolocation\"\n        sandbox=\"allow-scripts allow-same-origin allow-forms allow-popups\"\n        styles={{ border: '1px solid #ccc', borderRadius: '8px' }}\n      />\n      <p>Content below the iframe.</p>\n    </div>\n  );\n}\n\nexport default MyPage;\n","lang":"typescript","description":"Demonstrates basic integration of the `Iframe` component, including essential layout props, explicit `frameBorder` setting, and examples of crucial `allow` and `sandbox` attributes for modern iframe security and feature control.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}