Giter Club home page Giter Club logo

react-codepen's Introduction

React <Codepen>

A react component to embed pens from codepen.io

Getting Started

  • Install with NPM - npm install --save react-codepen

Usage

var React   = require('react');
var Codepen = require('react-codepen');

var Component = React.createClass({
  render: function () {
    return (
      <Codepen user="jasonbellamy" hash="XmWNEY"></Codepen>
    );
  }
});

Options

Property Type Argument Values Default Description
user string <required> null codepen.io username.
hash string <required> null the hash id of the pen to display.
height string <optional> px, % 250px the height of the pen.
width string <optional> px, % 100% the width of the pen.
tab string <optional> css, html, js, result result the default tab that should be displayed.
theme string <optional> default the theme the pen should use.

Developing

react-codepen is built using ES6. Run the following task to compile the src/ into dist/.

npm run build

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.

License

Copyright (c) 2015 Jason Bellamy
Licensed under the MIT license.

react-codepen's People

Contributors

jasonbellamy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-codepen's Issues

Codepen embed version

Hi there!

I was trying to get a layout like the following done and was not able to:

image

Come to find out it's because of two things:

  • embed-version=2 (it seems like something Codepen now allows)
  • default-tab="js,result" (it seems that now Codepen allows more than one result to be passed at a time)

Here is a sample embed code:

<iframe height='266' scrolling='no' src='//codepen.io/sergiocruz/embed/ZWmvYb/?height=266&theme-id=dark&default-tab=js,result&embed-version=2' frameborder='no' allowtransparency='true' allowfullscreen='true' style='width: 100%;'>See the Pen <a href='https://codepen.io/sergiocruz/pen/ZWmvYb/'>Convert React component from Class to Stateless Function</a> by Sergio Cruz (<a href='http://codepen.io/sergiocruz'>@sergiocruz</a>) on <a href='http://codepen.io'>CodePen</a>.
</iframe>

I'll be happy to open a pull request address these new features if you'd like :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.