cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation


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.

              <div id="root"></div>
<div id="peek"></div>
              // Create an "add" action
var ExampleActions = Reflux.createActions([

// A small store that has nested state data
var Store = Reflux.createStore({
  state: {
    counter: {
      clicks: 0
  init: function() {
    this.peekDiv = document.getElementById('peek');
  // A helper function to show what the actual count in the store is outside of React's render cycle
  showActualCount: function() {
    this.peekDiv.innerText = 'Actual count in the store: ' + this.state.counter.clicks;
  // Action handler for adding
  onAdd: function() {

// Small component that displays the click count and adds when you click
var MyComponent = React.createClass({
  getInitialState: function() {
    return Store.state
  componentDidMount: function() {
    Store.listen(function(newState) {
  shouldComponentUpdate: function(nextProps, nextState) {
    // This should work, but nextState.counter === this.state.counter!
    return nextState.counter.clicks !== this.state.counter.clicks;
  render: function() {
    return (
      <div onClick={ExampleActions.add}>
        Click me to increment the count. You'd never know it, though, because mutable data has ruined the shouldComponentUpdate method!
        <br />
        Click Count: {this.state.counter.clicks}

React.render(<MyComponent />, document.getElementById('root'));
Loading ..................