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="code-box">
  <div class="stage draggable">
    <div class="code">
      <code class="language-js">
    // Prepare header.
    $headers = [
      'Content-Type' => 'application/json',
      'Authorization' => $fcm_auth,
    // Prepare body.
    $body = [
      'to' => '/topics/all',
      'notification' => [
        'title' => 'Hey! New Message',
        'body'  => 'Kevin says: Hey!',
        'icon'  => 'fcm_push_icon',
        'color' => '#F79838',
        'sound' => 'default',
      'priority' => 'high',
      'click_action' => 'FCM_PLUGIN_ACTIVITY',

    // Send it.
        'json' => $body,
        'headers' => $headers
    <div class="app" style=""></div>
    <div class="toggle"></div>


                .code-box {
  width: 545px;
  margin: 30px auto;
  box-shadow: 0 8px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.04);
  background: #fff;
  border-radius: 4px;

.draggable {
  position: relative;
  height: 345px;

.draggable .app,
.draggable .code {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: #fff;
  border-radius: 8px;

.draggable .code pre {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: 0;
  padding: 0;
  background-color: #fff;
  border: 0;
  overflow: hidden;
  line-height: 0;
  counter-reset: line;
  white-space: pre-wrap;
  font-family: monospace;

.draggable .app {
  position: absolute;
  right: 0;
  padding: 9px 0 0 9px;
  background: #fff url( no-repeat 0 bottom;
  background-size: 540px;
  overflow: hidden;

.draggable .toggle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 4px;
  background: #fff;
  box-shadow: 0 0 18px rgba(0,0,0,.1), 0 0 4px rgba(0,0,0,.06);
  z-index: 3;
  cursor: grab;
  cursor: -webkit-grab;

.draggable .toggle::after {
  content: '';
  display: block;
  position: absolute;
  top: calc(50% - 40px);
  left: -28px;
  width: 64px;
  height: 64px;
  background: url( no-repeat 0 0;
  background-size: 64px;


                $(function() {
    var app = $('.code-box .app');
    var code = $('.code-box .code');
    var toggle = $('.toggle');
    var size = $('.code-box .stage').width();
    // Init default pos.
    app.css('right', size / 2);
    toggle.css('left', size / 2);
    // Change pos on dragging
        containment: ".stage",
        axis: "x",
        drag: function(event, ui) {
          var pos = size - ui.position.left;
          app.css('right', pos);