Skip to content

Instantly share code, notes, and snippets.

@rahmanusta
Created February 26, 2016 12:44
Show Gist options
  • Save rahmanusta/77edeee2fd5f02e7c8bf to your computer and use it in GitHub Desktop.
Save rahmanusta/77edeee2fd5f02e7c8bf to your computer and use it in GitHub Desktop.
jumbotron React Component
var Jumbotron = React.createClass({
render: function () {
return (<div className="jumbotron">
<h1>{this.props.title || "Hello, world"}!</h1>
<p>{this.props.content || "No content"}</p>
<p>
<a className="btn btn-primary btn-lg" href={this.props.link} role="button">
{this.props.more || "Learn more"}
</a>
</p>
</div>);
}
});
var lorem = `Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab aspernatur assumenda consectetur corporis deleniti dolores
illum impedit ipsa iure, magni odit optio perferendis, perspiciatis sapiente sed temporibus unde vitae voluptatibus!`;
var settings = {
title: "Merhaba Dünya",
content: lorem,
more: "Dahası",
link: "http://kodcu.com"
};
var root = document.querySelector("#placeholder");
ReactDOM.render(<Jumbotron {...settings} />, root);
/*
ReactDOM.render(<Jumbotron title="Merhaba Dünya"
content={lorem}
more="Dahası"
link="http://kodcu.com" />, root);
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment