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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

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


                <!-- template for the modal component -->
<script type="x/template" id="modal-template">
    <transition name="modal">
        <div class="modal-mask" @click="close" v-show="show">
            <div class="modal-container" @click.stop>
                <div class="modal-header">
                    <h3>New Post</h3>
                <div class="modal-body">
                    <label class="form-label">
                        <input class="form-control">
                    <label class="form-label">
                        <textarea rows="5" class="form-control"></textarea>
                <div class="modal-footer text-right">
                    <button class="modal-default-button" @click="savePost()">

<!-- app -->
<div id="app">
    <modal :show="showModal" @close="showModal = false"></modal>
    <button id="show-modal" @click="showModal = true">New Post</button>


                * {
    box-sizing: border-box;

.modal-mask {
    position: fixed;
    z-index: 9998;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, .5);
    transition: opacity .3s ease;

.modal-container {
    width: 300px;
    margin: 40px auto 0;
    padding: 20px 30px;
    background-color: #fff;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .33);
    transition: all .3s ease;
    font-family: Helvetica, Arial, sans-serif;

.modal-header h3 {
    margin-top: 0;
    color: #42b983;

.modal-body {
    margin: 20px 0;

.text-right {
    text-align: right;

.form-label {
    display: block;
    margin-bottom: 1em;

.form-label > .form-control {
    margin-top: 0.5em;

.form-control {
    display: block;
    width: 100%;
    padding: 0.5em 1em;
    line-height: 1.5;
    border: 1px solid #ddd;

 * The following styles are auto-applied to elements with
 * transition="modal" when their visibility is toggled
 * by Vue.js.
 * You can easily play with the modal transition by editing
 * these styles.

.modal-enter {
  opacity: 0;

.modal-leave-active {
  opacity: 0;

.modal-enter .modal-container,
.modal-leave-active .modal-container {
  -webkit-transform: scale(1.1);
  transform: scale(1.1);


                Vue.component('modal', {
  template: '#modal-template',
  props: ['show'],
  methods: {
    close: function () {
    savePost: function () {
      // Some save logic goes here...

new Vue({
  el: '#app',
  data: {
    showModal: false