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.


                <!doctype html>
    <script src=''></script>
    <script src=''></script>
    <script src=''></script>
    <script src=""></script>
    <script src=''></script>
    <link href='//' rel='stylesheet'>
    <script data-template-name='application' type='text/x-handlebars'>
      <div class="container">
      <h4>EmberJS Dynamic SVG Display</h4>
      <br />
          <rect width=60 height=60 {{bind-attr fill=data.bgColor}} />
          <circle r=20 transform="translate(30,30)" {{bind-attr fill=data.color}} />
      window.Mini = Ember.Application.create();
      var user_id = "User " + Math.round(Math.random() * 1000);

      Mini.PubNub = PubNubEmber.extend({
        cfg: {
          subscribe_key: 'demo',
          publish_key: 'demo',
          uuid: user_id

      Mini.ApplicationController = Ember.Controller.extend({
        channel: 'The EmberJS Dynamic SVG Channel',
        data: new Ember.Object(),
        user_id: user_id,

        init: function() {
          var pn   = this.get('pubnub');   // PubNub service instance
          var chan = this.get('channel');  // channel name
          var self = this;                 // reference to 'this' for callbacks

          this.get('data').set('color', 'white');
          this.get('data').set('bgColor', 'black');

          // Subscribe to the Channel
          pn.emSubscribe({ channel: chan });

          // Register for message events
          pn.on(pn.emMsgEv(chan), function(payload){
            var state = payload.message;
            self.get('data').set('color', state.color);
            self.get('data').set('bgColor', state.bgColor);

          // Populate latest state from history (optional)
            channel: chan,
            count: 1