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 id="app">
  <div class="jumbotron w-100">
    <div class="row">
      <div class="col-12">
        <h2 class="text-center mb-5">Using Watchers in Vue</h2>
      <!-- Control Panel -->
      <div class="col-xs-12 col-sm-12 col-md-5">
        <div class="form">
          <div class="form-group">
            <label for="message">Your message <small>(30 chars)</small></label>
            <input id="message" type="text" 
                   class="form-control" v-model="message" maxlength="30"/>
          <div class="form-group">
            <label for="speed">
              Typing speed delay: {{ speed }} <small>(in ms)</small>
            <input id="speed" type="range" 
                   class="form-control" v-model="speed" 
                   :min="minSpeed" :max="maxSpeed"> 
      <!-- Preview Area -->
      <div class="col-xs-12 col-sm-12 col-md-7 text-center">
        <label class="my-3">Preview</label>
        <h4 class="display-5">{{ previewHint }}  </h4>
        <h3 class="display-5" v-show="showTypewriter" ref="typed"></h3>



                html, body {
    height: 100%;

#app {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;

.jumbotron {
  border-radius: 0px;
  background: #80DEEA;;

h2 {
  font-size: 3rem;
  text-shadow: 1px 1px 2px #607d8b;
  color: #E0F7FA;

.form {
  background: #B2EBF2;
  padding: 10px;
  border-radius: 5px;
  margin: 10px;
  box-shadow: 1px 1px 1px 1px #00000029;

.bg-color {
  background-color: #ddd;

[v-cloak] {
  display: none;



                new Vue({
  el: "#app",
  data() {
    return {
      message: "Thinking in components",
      speed: 150,
      minSpeed: 100,
      maxSpeed: 500,
      previewHint: '',
      showTypewriter: true
  created() {
    this.debouncedTyper = _.debounce(this.typer, 2000)
  mounted() {
  methods: {
      const symbols = this.message.split("")
      const result = []
      const animation = () => setTimeout(tick, this.speed)
      let tick = () => {
        const character = symbols.shift()
        if(symbols.length) animation()
      this.showTypewriter = true
      this.previewHint = ""
    redraw(text) {
      this.$refs.typed.innerText = text
  watch: {
    message: function(newMessage, oldMessage) {
      this.previewHint = "Waiting for you to stop typing.."
      this.showTypewriter = false
    speed: function(newSpeed, oldSpeed) {
      this.previewHint = "Waiting for you to stop tinkering with speed control.."
      this.showTypewriter = false