Skip to content

Playground

Tweak props on the left, edit JSON on the right, then copy the generated component code. Events are logged below.

<script setup>
import { ref } from 'vue'
import Vue3Jsoneditor from 'v3-jsoneditor'

const json = ref({
    "id": 42,
    "name": "Ada Lovelace",
    "email": "ada@example.com",
    "active": true,
    "roles": [
      "admin",
      "editor"
    ],
    "address": {
      "city": "London",
      "country": "UK"
    },
    "lastLogin": null
  })
const mode = ref('tree')
const fullscreen = ref(false)
const readOnly = ref(false)
const mainMenuBar = ref(true)
const navigationBar = ref(true)
const statusBar = ref(true)
const indentation = ref(2)
</script>

<template>
  <Vue3Jsoneditor
    v-model="json"
    v-model:currentMode="mode"
    v-model:fullscreen="fullscreen"
    theme="auto"
    height="420px"
  />
</template>

Looking for the full reference? See Props, Events and Methods.

Released under the MIT License.