Created
May 28, 2014 23:03
-
-
Save artisonian/786fb4a7c490e0aa58c9 to your computer and use it in GitHub Desktop.
React Starter Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { padding-top: 70px; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"/> | |
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-glyphicons.css"/> | |
<script src="//fb.me/react-with-addons-0.10.0.js"></script> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @jsx React.DOM */ | |
var Panel = React.createClass({ | |
getDefaultProps: function () { | |
return { | |
type: 'default' | |
}; | |
}, | |
render: function () { | |
return ( | |
<div className={'panel panel-' + this.props.type}> | |
<div className="panel-heading"> | |
<h3 className="panel-title">{this.props.title}</h3> | |
</div> | |
<div className="panel-body"> | |
{this.props.children} | |
</div> | |
</div> | |
); | |
} | |
}); | |
var App = React.createClass({ | |
render: function () { | |
return ( | |
<div> | |
<div className="navbar navbar-default navbar-fixed-top"> | |
<div className="navbar-header"> | |
<a className="navbar-brand" href="http://facebook.github.io/react/docs">React Docs</a> | |
</div> | |
</div> | |
<div className="container"> | |
<div className="row"> | |
<div className="col-sm-12"> | |
{this.props.children} | |
</div> | |
</div> | |
</div> | |
</div> | |
); | |
} | |
}); | |
React.renderComponent( | |
<App> | |
<Panel title="Hello world"> | |
<p>Lorem ipsum dolor, sit amet...</p> | |
</Panel> | |
</App>, | |
document.body | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment