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

v0.1.7

Published

[![Build Status](https://api.travis-ci.com/psynewave/react-mframe.svg?branch=master)](https://travis-ci.com/psynewave/react-mframe) [![NSP Status](https://nodesecurity.io/orgs/psynewave/projects/0f9b6ff1-23bc-4e99-a95c-1f9815225414/badge)](https://nodesec

Downloads

14

Readme

React MFrame

Build Status NSP Status Coverage Status

A react component for making adding iframes to your react project as simple as possible. Supports both external iframes and dynamic iframes using react portal. You can add event listeners pass dynamic styles and even have your dynamic content iframes resize automatically.

Getting Started

IFrame - Load and Mouse Interaction Events

<MFrame src="https://share.constitutioncenter.org/amendment-xi"
        width="560"
        id="ConstitutionEmbed"
        className="iFrameConstitution"
        height="360"
        onLoad={() => { triggeredEvent("onload", "was triggered")}}
        onMouseOver={() => {  triggeredEvent("onmouseover", "has occurred") }}
        onMouseOut={() => { triggeredEvent("onmouseout", "has occurred") }}
        border="10px solid blue"
        allowFullScreen
/>

IFrame - Responsive Iframe

<div style={{ position: "relative", paddingBottom: "56.25%", paddingTop: "35px", height: 0, overflow: "hidden"}}>
    <MFrame src="https://www.youtube.com/embed/pTA0DSfrGZ0"
            responsive
            allowFullScreen
    />
</div>

Iframe - Using sandbox options

<MFrame src="https://platform.twitter.com/widgets/tweet_button.html"
            position="relative"
            width="61px"
            id="TwitterEmbed"
            className="twitterFrame"
            height="20px"
            allow="geolocation"
            sandbox="allow-same-origin allow-scripts allow-popups allow-forms"
            allowFullScreen
/>

IFrame - Setting Scrolling Margins Etc...

<MFrame src="https://maps.google.com/maps?width=100%&amp;height=600&amp;hl=en&amp;coord=37.374907, -122.012103&amp;q=740%20Kifer%20Rd%20Sunnyvale%2C%20CA%2094086+(MLSListings)&amp;ie=UTF8&amp;t=&amp;z=14&amp;iwloc=B&amp;output=embed"
        position="relative"
        width="100%"
        id="GoogleMapEmbed"
        height="600"
        allow="geolocation"
        marginheight="10"
        marginwidth="0"
        scrolling="no"
        sandbox="allow-same-origin allow-scripts allow-popups allow-forms"
        allowFullScreen
/>

IFrame - Passing Custom Content.

<MFrame head={customHead("Passed Title", customStyles)}
        height="200"
        position="relative"
        marginheight="10"
        >
    <div>
    <h1 className="red">Salve Terra Rubrum</h1>
    <h1 className="blue">Salve Terra Caeruleum</h1>
    </div>
</MFrame>

IFrame - Autosizing Custom Content - Inject External CSS

    <MFrame
    head={customHead("Passed Title", undefined, ["https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css", "https://use.fontawesome.com/releases/v5.3.1/css/all.css"])}
    width="50%"
    autoResizeContent
    >
    <div>
    <div className="alert alert-success" role="alert">
        <h4 className="alert-heading">Hac impulsi occasione</h4>
    <p><i className="fas fa-allergies"></i> Quieta Gallia Caesar, ut constituerat, in Italiam ad conventus agendos proficiscitur. Ibi cognoscit de Clodii caede [de] senatusque consulto certior factus, ut omnes iuniores Italiae coniurarent, delectum tota provincia habere instituit.</p>
        <hr />
        <p className="mb-0">Eae res in Galliam Transalpinam celeriter perferuntur. Addunt ipsi et adfingunt rumoribus Galli, quod res poscere videbatur, retineri urbano motu Caesarem neque in tantis dissensionibus ad exercitum venire posse.</p>
    </div>
    <div className="card" style={{width: "18rem"}}>
        <img className="card-img-top" src="http://lorempixel.com/180/100/" alt="MLS Logo" />
        <div className="card-body">
        <h5 className="card-title">Indictis inter se principes Galliae</h5>
        <p className="card-text">In primis rationem esse habendam dicunt, priusquam eorum clandestina consilia efferantur, ut Caesar ab exercitu intercludatur.</p>
        <a href="http://www.mlslistings.com" className="btn btn-primary">In Via</a>
        </div>
    </div>
    </div>
    </MFrame>

Example Functions

I just used these to demonstrate how you can pass custom functions to MFrame they aren't anything special I just personally get frustrated when documentation mentions a function without defining it.

export const triggeredEvent = (event, message) => {
    console.log(`${event} ${message}`);
}
export const customHead = (title, styles, links) => (
    <MFrameCustomHead title={title} styles={styles} links={links} />
);

Built With

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments