A react component to embed pens from codepen.io
- Install with NPM -
npm install --save react-codepen
var React = require('react');
var Codepen = require('react-codepen');
var Component = React.createClass({
render: function () {
return (
<Codepen user="jasonbellamy" hash="XmWNEY"></Codepen>
);
}
});
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. |
react-codepen is built using ES6. Run the following task to compile the src/
into dist/
.
npm run build
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.
Copyright (c) 2015 Jason Bellamy
Licensed under the MIT license.