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" @dragover.prevent @drop.prevent>
    <div class="container" @dragleave="fileDragOut" @dragover="fileDragIn" @drop="handleFileDrop" @drop="fileDragOut" v-bind:style="{ 'background-color': color }">
      Add your files here:
      <div class="file-wrapper">
        <input type="file" name="file-input" multiple="True" @change="handleFileInput" > Click or drag to insert.
        <li v-for="(file, index) in files">
          {{ }} ({{ file.size }} b)
          <button @click="removeFile(index)" title="Remove">X</button>


  height: 100%;
main {
  margin-top: 30px;
  height: 100%;
.container {
  border: 2px dashed pink;
  min-height: 150px;
#app {
  border: 1px solid yellow;
  height: 100vh;
.file-wrapper {
  text-align: center;
  width: 300px;
  height: 5em;
  vertical-align: middle;
  display: table-cell;
  position: relative;
  overflow: hidden;
  background: gray; /* and other things to make it pretty */

.file-wrapper input {
    position: absolute;
    top: 0;
    right: 0; /* not left, because only the right part of the input seems to
                 be clickable in some browser I can't remember */
    cursor: pointer;
    opacity: 0.0;
    filter: alpha(opacity=0); /* and all the other old opacity stuff you
                                 want to support */
    font-size: 300px; /* wtf, but apparently the most reliable way to make
                         a large part of the input clickable in most browsers */
    height: 200px;


                var app = new Vue({
  el: '#app',
  data: {
    files: [],
    color: '#444444',
  methods: {
    handleFileDrop(e) {
      let droppedFiles = e.dataTransfer.files;
      if(!droppedFiles) return;
      // this tip, convert FileList to array, credit:
      ([...droppedFiles]).forEach(f => {
    handleFileInput(e) {
      let files =;
      files =
            if(!files) return;
      // this tip, convert FileList to array, credit:
      ([...files]).forEach(f => {
      this.files.splice(fileKey, 1)
      // alert("oof")
      // alert("color")