npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-iframe

v1.8.5

Published

Easy peasy lemon squeezy iframes with react

Downloads

399,774

Readme

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 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.