Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <div class="container" id="app"></div>


  padding-top: 32px
  background: #ecf0f1

  text-decoration: underline
  max-width: 600px
  border: 1px solid green
    border-bottom: 2px solid green
    background-color: green
    color: white
    font-size: 20px
    text-align: center
    font-size: 14px


                var Table = React.createClass({
  _createClickHandler: function(displayValue) {
    return function() {
      this.setState({display: displayValue}, this._search);
  _search: function() {
      method: 'GET',
      url: '' + this.state.display,
      success: this._replaceResults
  _replaceResults: function(response) {
    this.setState({campers: response});
  componentWillMount: function () {
  getInitialState: function() {
    return {
      display: "recent",
      campers: []
  render: function() {
    var rows = [];
    this.state.campers.forEach(function(camper, i) {
      rows.push(<TableRow number={i + 1} name={camper.username} recent={camper.recent} alltime={camper.alltime} img={camper.img} key={i} />);
    return (
      <div className="panel panel-default">
        <div className="panel-heading">FCC Leaderboard</div>
        <table className="table">
              <th>Camper Name</th>
              <th onClick={this._createClickHandler('recent')} 
                className={this.state.display === 'recent' ? 'underline' : ''}>Points in past 30 days</th>
              <th onClick={this._createClickHandler('alltime')} 
                className={this.state.display === 'alltime' ? 'underline' : ''}>All time Points</th>

var TableRow = React.createClass({
  render: function() {
    return (
        <td>{this.props.number || '1'}</td>
        <td><img src={this.props.img} width="30px" /></td>
        <td>{ || 'camper'}</td>
        <td>{this.props.recent || '10'}</td>
        <td>{this.props.alltime || '100'}</td>

ReactDOM.render(<Table />, document.getElementById('app'));