Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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.


Auto Save

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 id="app">


                $size: 16px

  font-family: sans-serif

  font-size: $size*2
  text-align: center
  font-weight: 700
  padding-top: 20px
  padding-bottom: 20px

  padding: 20px
  text-align: center
  margin-left: auto
  margin-right: auto
td, th 
  padding: 10px
  vertical-align: middle
  font-size: $size
    width: 60px
    height: 60px
  border: 1px solid #999
  color: #333
  @extend .row
  background-color: #999

  @extend .row
  background-color: white
  font-weight: 700
  color: gray
  text-decoration: underline
  cursor: pointer

  font-weight: 400
  color: black
  text-decoration: underline
  cursor: pointer

  width: 2*$size
  margin: 50px 0 50px 0
  font-size: 30px
  text-align: center


                class App extends React.Component {
  render() {
    return <div>
      <h1>FreeCodeCamp Leaderboard</h1>
      <LeaderBoard />
      <p>Code by <a href="" target="_blank">Luke Walker</a></p>

class UserRow extends React.Component {
  render() {
    var rank = this.props.index + 1;
    var rowStyle = rank % 2 === 0 ? 'evenRow' : 'oddRow'
    return <tr className={rowStyle} key={rank}><td>{rank}</td><td><img src={this.props.avatar} /></td><td>{this.props.username}</td><td>{this.props.recent}</td><td>{this.props.alltime}</td></tr>;

class LeaderBoard extends React.Component {
  constructor(props) {
    this.state = { users: [], sort: 'Recent', loading: true } 
    this.recent = this.recent.bind(this)
    this.alltime = this.alltime.bind(this)
  componentDidMount() {
  renderLoading() {
    return <div id="loading">Loading...</div>
  recent() {
    .then(data => this.setState({ users: data, sort: 'Recent', loading: false }))
  alltime() {
    .then(data => this.setState({ users: data, sort: 'All Time', loading: false }))
  render() {
    var leaderList =, idx) => <UserRow index={idx} avatar={user.img} username={user.username} recent={user.recent} alltime={user.alltime} /> )
    return <table>
      <thead><tr><th>Rank</th><th>Avatar</th><th>Username</th><th onClick={this.recent} className={this.state.sort === 'Recent' ? 'selected' : 'unselected'}>Recent</th><th onClick={this.alltime} className={this.state.sort === 'All Time' ? 'selected' : 'unselected'}>All Time</th></tr></thead>
      <tbody>{ this.state.loading? this.renderLoading() : leaderList }</tbody></table>

var recent = ""
var alltime = ""        
ReactDOM.render(<App />, document.querySelector('#app'))