Pen Settings



CSS Base

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

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.


  <h1>Hello, Vue 3 Reactivity API! :)</h1>
  <p><strong>Counter:</strong> {{ counter }}</p>
  <button @click="counter++">+ Increment counter</button>
  <button @click="counter--">- Decrement counter</button>
  <h3>Hello! My name is <mark>{{ }}</mark>. I'm <mark>{{ person.age }}</mark> years old.</h3>
  <p>Edit person's name
    <input v-model="" placeholder="name" /> and age
    <input v-model="person.age" placeholder="age" />
  <p><strong>PI:</strong> {{ math.PI }}</p>
  <button @click="math.PI = 6.28">Double PI</button> <span>(The console output after the button is clicked: <em>"Set operation on key 'PI' failed: target is readonly."</em>)</span>
  <h3>Alphabet Numbers</h3>
    <tr v-for="(value, key) in alphabetNumbers">
      <td>{{ key }}</td>
      <td>{{ value }}</td>
  <button @click="alphabetNumbers.B = 3">Change the value of B to 3</button><span> (Actually the letter B <em>is</em> changed to number 3 - <button @click="showValue">Show the value of B</button>, but it's <em>not</em> tracked by Vue.)</span>

  import { ref, reactive, readonly, markRaw, isRef, isReactive, isReadonly, isProxy, onMounted } from 'vue';
  export default {
    setup () {
      const counter = ref(0)
      const person = reactive({
        name: 'David',
        age: 36
      const math = readonly({
        PI: 3.14
      const alphabetNumbers = markRaw({
        A: 1,
        B: 2,
        C: 3
      const showValue = () => {
        alert(`The value of B is ${alphabetNumbers.B}`)
      onMounted(() => {
        console.log(isRef(counter)) // true
        console.log(isReactive(person)) // true
        console.log(isReadonly(math)) // true
        console.log(isProxy(alphabetNumbers)) // false
      return {

  table, th, td {
    border: 1px solid black;
    border-collapse: collapse;
    padding: 5px;