Skip to content

Vue3 JSON ViewerBeautiful JSON visualization for Vue 3

A customizable, TypeScript-first JSON viewer with persistent expand/collapse, dark & light themes, typed events, and copy-to-clipboard.

Vue3 JSON Viewer

Try it live ​

obj{
"name": "Vue3 JSON Viewer",
"version": "0.6.0",
"features":4[
"dark mode",
"expand/collapse",
"events",
"copy"
],
"stats":obj{
"stars": 128,
"downloads": 42000,
"typescript": true
},
"createdAt": "2024-01-01T00:00:00.000Z",
"maintainer": null
}
Interact with the viewer — toggle a node or copy a value — to see events here.

Quick Start ​

Install the package:

bash
npm install @anilkumarthakur/vue3-json-viewer

Use it in a component:

vue
<script setup lang="ts">
  import { JsonViewer } from '@anilkumarthakur/vue3-json-viewer';
  import '@anilkumarthakur/vue3-json-viewer/styles.css';

  const data = {
    name: 'John Doe',
    age: 30,
    hobbies: ['reading', 'coding'],
  };
</script>

<template>
  <JsonViewer
    :data="data"
    :dark-mode="true"
  />
</template>

Why Vue3 JSON Viewer? ​

FeatureDescription
ðŸŽŊ Zero dependenciesOnly Vue 3 as a peer dependency
ðŸ“ą ResponsiveThe root container scrolls; works on any screen size
🧠 State that persistsExpand/collapse survives collapsing a parent node
🚀 EfficientCollapsed subtrees aren't rendered at all
🔧 CustomizableProps for theme & initial state, CSS classes for the rest

Released under the MIT License.