Getting Started â
Vue3 JSON Viewer is a beautiful, customizable JSON viewer component for Vue 3. It gives you an interactive, syntax-highlighted tree for any JSON-like value â ideal for debugging panels, API explorers, admin tools, and docs.
Features â
- ðĻ Beautiful UI â gradient backgrounds and per-type syntax highlighting
- ð Dark & light mode â switchable with a single prop
- ðĶ TypeScript-first â authored in TSX with complete, exported types
- ð Persistent expand/collapse â node state survives collapsing an ancestor
- ðĄ Typed events â
@toggleand@copywith typed payloads - ð Copy to clipboard â one click, with a fallback for non-secure contexts
- ð Rainbow nesting â color-coded bracket levels
- ðŠķ Lightweight â ~3.7 KB gzipped, Vue 3 as the only peer dependency
Live Preview â
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
}
Prerequisites â
- Vue 3.3.0 or higher
- A bundler that imports CSS (Vite, webpack, etc.), or a CDN setup
Installation â
bash
npm install @anilkumarthakur/vue3-json-viewerbash
yarn add @anilkumarthakur/vue3-json-viewerbash
pnpm add @anilkumarthakur/vue3-json-viewerbash
bun add @anilkumarthakur/vue3-json-viewerQuick Example â
vue
<script setup lang="ts">
import { JsonViewer } from '@anilkumarthakur/vue3-json-viewer';
import '@anilkumarthakur/vue3-json-viewer/styles.css';
const jsonData = {
name: 'Vue3 JSON Viewer',
version: '0.6.0',
features: ['dark mode', 'expand/collapse', 'events', 'copy'],
};
</script>
<template>
<JsonViewer
:data="jsonData"
:dark-mode="true"
:expanded="true"
/>
</template>What's Next? â
- Installation â package managers, CDN, SSR
- Quick Start â get running in minutes
- Data Types â what each value looks like
- Events â react to toggles and copies
- API Reference â props, events, and types
- Playground â experiment live