• Stars
    star
    412
  • Rank 105,024 (Top 3 %)
  • Language
    TypeScript
  • License
    ISC License
  • Created over 9 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple solution for using iframes in React

React Iframe

Simple React component for including an iframed page.

Youtube in an iframe

The component is fully typescript-supported.

Usage

import Iframe from 'react-iframe'
<Iframe url="https://www.sdrive.app/embed/1ptBQD"
        width="640px"
        height="320px"
        id=""
        className=""
        display="block"
        position="relative"/>

Properties

url (required) - string the iframe url.

all other attributes are optional

src - string if set, overrides url.

scrolling - string not set if if not provided (deprecated in HTML5).

overflow - string default to "hidden".

loading - string (not added to DOM if not provided).

frameBorder - number default to "0" (deprecated in HTML5).

position - string (not added to DOM if not provided).

id - string if set, adds the id parameter with the given value.

className - string if set, adds the class parameter with the given value.

display - string defaults to "block"

height - string (1px > any number above 0, or 1% to 100%)

width - string (1px > any number above 0, or 1% to 100%)

allowFullScreen - if set, applies the allowFullScreen param (deprecated in HTML5). If set, adds allow="fullscreen".

sandbox - add optional sandbox values. For single value, add as string. For multiple values, add as array ({"allow-scripts", "allow-same-origin"}). Valid values are "allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts allow-top-navigation"

allow - add optional allow values ("geolocation microphone camera midi encrypted-media & more")

styles - add any additional styles here. Will (intentionally) override any of the props above. For instance:

<Iframe url="http://www.youtube.com/embed/xDMP3i36naA"
            position="absolute"
            width="100%"
            id="myId"
            className="myClassname"
            height="100%"
            styles={{height: "25px"}}/>

will set the height to 25px even though it was specified as 100% in the props.

A comprehensive overview of the iframe element is available from the MDN web docs.

Development

All source code resides in the src/ folder. The other code paths are generated by the tsc compiler.

When to use

This project provides a convenient TypeScript-enabled wrapper around the native HTML <iframe> tag. You can achieve the same functionality with the native tag. You do not need to use TypeScript in your project to consume this library.

More Repositories

1

react-breadcrumbs

Automatic breadcrumbs for React-Router
JavaScript
410
star
2

Rantjs

Procedurally generate text with JavaScript
JavaScript
220
star
3

learn-react

Examples and modules that shows you how to use React
JavaScript
92
star
4

upcoming-conferences

Upcoming web developer conferences
90
star
5

react-stickydiv

React Component which keeps any HTML element sticky whenever it is scrolled beyond view
JavaScript
58
star
6

svenjs

A JavaScript framework for composable web apps
JavaScript
45
star
7

isomorphic-react-boilerplate

JavaScript
13
star
8

iAdHelper

Objective-C Helper class to ease integration with iAD for Cocos2D v3
Objective-C
12
star
9

ezreact

The easiest way to get started with React.js development
JavaScript
11
star
10

react-markdown-to-html

React Component that converts a Markdown file to HTML
JavaScript
9
star
11

React-Reflux-Presentation-Apr-21-2015-Teknologihuset-Oslo

React/Reflux Presentation Apr 21 2015 Teknologihuset Oslo
8
star
12

iOS7-Rest-Example-App

Consumes a REST API in iOS7 and populates a table view with the results
Objective-C
5
star
13

react-editable-div

React Component that enables editable divs
JavaScript
5
star
14

heroku-apigility

Heroku buildpack for hosting Apigility APIs
Puppet
4
star
15

reverse-spaceinvaders

You are the alien. Get them boys.
JavaScript
4
star
16

dom-find

Utils for finding DOM elements. Used by react-stickydiv
JavaScript
4
star
17

react-grid

A visual HTML gridsystem on top of Bootstrap 3
JavaScript
3
star
18

tictactoe

The classic game in pure javascript
JavaScript
3
star
19

Python-fundamentals

Assignments from the Python fundamentals course
Python
3
star
20

reactnative-uvapp

A port of Inmetas UV App to React Native
Objective-C
2
star
21

zombietron2084

Ludum Dare #31. It's 2084 and Zombies are everywhere. Your job is to take them out, and save the innocent people roaming around.
JavaScript
2
star
22

koa-proxy

A fantastic proxier for Koa 2
JavaScript
2
star
23

ezreact-starter

Starter app for EZReact
JavaScript
2
star
24

cra-react-iframe

React-iframe demo using CRA
JavaScript
2
star
25

SecureHash

Secure hash class for PHP
PHP
2
star
26

zf2-smarty-skeleton

PHP
1
star
27

Newhomepage

New blog homepage
PHP
1
star
28

ReactJSBlueprints

A collection of all the code provided in my book ReactJS Blueprints
1
star
29

imagetocanvas

Helper tools to put an image on a canvas
JavaScript
1
star
30

Lille-gangetabellen

En liten gangetabell
Processing
1
star
31

sdrive-docs

SDrive & Shadow Drive docs
1
star
32

universal-jsx

A standalone JSX compiler
JavaScript
1
star
33

Recsys-pa2

My solution to Recommender Systems Programming Assignment 2
1
star
34

zf2blog

Blog application using Zend Framework and Twig. Requires PHP v5.3.3 or above.
PHP
1
star
35

random-guid

Generate a random GUID
JavaScript
1
star
36

recsys_wa2

My solution to WA2 for Coursera course Introduction to Recommender Systems
Java
1
star
37

kafka-consumer

Start app for consuming Kafka topics
Rust
1
star
38

reactjs-presentation-javazone2014

Min presentasjon pƄ JavaZone 2014
1
star
39

spacemonkey_processing_2

SHMUP made in Processing2
JavaScript
1
star
40

svg-sprites

demo
JavaScript
1
star
41

Recsys---Programming-Assignment-1

My solution to the first programming assigment for the Recommender System course
1
star
42

SarPoTwigExtractor

Module that traverses a given folder, extracts all strings within translate('') and stores every new string in the modules language files. Made for Zend Framework 2
PHP
1
star
43

universal-jsx-loader

Webpack loader for universal-jsx
JavaScript
1
star
44

security

JavaScript
1
star