npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

json-schema-form-vue3

v0.4.2

Published

A Vue 3 component for editing JSON Schema with nested object and array support

Readme

JSON Schema Form Vue3 + Element Plus

A Vue 3 component for editing JSON Schema with nested object and array support, built with Element Plus.

中文文档

Installation

npm install @json-schema-form-vue3

Features

  • Support for all JSON Schema types
  • Nested object properties
  • Array type with customizable item types
  • Clean and modern UI with Element Plus
  • Full TypeScript support
  • Easy to use v-model interface

Quick Start

1. Install Dependencies

npm install json-schema-form-vue3 element-plus

2. Use in Your Component

You can use the component in two ways:

Global Registration

import { createApp } from 'vue'
import JsonSchemaFormVue3 from 'json-schema-form-vue3'
import 'json-schema-form-vue3/style.css'  // Don't forget to import styles

const app = createApp(App)
app.use(JsonSchemaFormVue3)

Then in your components:

<template>
  <json-schema-form v-model="schema" />
</template>

<script setup lang="ts">
import { ref } from 'vue'
import type { JsonSchema } from 'json-schema-form-vue3'

const schema = ref<JsonSchema>({
  type: 'object',
  properties: {
    name: {
      type: 'string',
      title: 'Name'
    },
    age: {
      type: 'number',
      title: 'Age'
    },
    hobbies: {
      type: 'array',
      title: 'Hobbies',
      items: {
        type: 'string'
      }
    },
    address: {
      type: 'object',
      title: 'Address',
      properties: {
        street: {
          type: 'string',
          title: 'Street'
        },
        city: {
          type: 'string',
          title: 'City'
        }
      }
    }
  },
  required: ['name', 'age']
})
</script>

Component API

Props

| Property | Type | Required | Default | Description | |----------|------|----------|----------|-------------| | modelValue | JsonSchema | SchemaProperty | Yes | - | The JSON Schema object bound through v-model | | isRootLevel | boolean | No | true | Whether this is a root level editor (affects UI display) |

Events

| Event Name | Parameter Type | Description | |------------|---------------|-------------| | update:modelValue | JsonSchema | SchemaProperty | Emitted when the schema changes |

Type Definitions

interface SchemaProperty {
  type: JSONSchema7TypeName; // 'string' | 'number' | 'integer' | 'object' | 'array' | 'boolean' | 'null'
  title?: string;
  description?: string;
  properties?: Record<string, SchemaProperty>;
  items?: SchemaProperty;
  required?: string[];
}

interface JsonSchema {
  type: 'object';
  properties: Record<string, SchemaProperty>;
  required?: string[];
  $schema?: string;
  $id?: string;
  $comment?: string;
  title?: string;
  description?: string;
}

Advanced Usage

Nested Objects Example

<template>
  <json-schema-form v-model="schema" />
</template>

<script setup lang="ts">
import { ref } from 'vue'
import JsonSchemaForm from 'json-schema-form-vue3'
import type { JsonSchema } from 'json-schema-form-vue3'

const schema = ref<JsonSchema>({
  type: 'object',
  properties: {
    user: {
      type: 'object',
      title: 'User Information',
      properties: {
        basicInfo: {
          type: 'object',
          title: 'Basic Information',
          properties: {
            name: {
              type: 'string',
              title: 'Name'
            },
            age: {
              type: 'number',
              title: 'Age'
            }
          },
          required: ['name']
        },
        contact: {
          type: 'object',
          title: 'Contact Information',
          properties: {
            email: {
              type: 'string',
              title: 'Email'
            },
            phone: {
              type: 'string',
              title: 'Phone'
            }
          }
        }
      }
    }
  }
})
</script>

Array Type Example

<template>
  <json-schema-form v-model="schema" />
</template>

<script setup lang="ts">
import { ref } from 'vue'
import JsonSchemaForm from 'json-schema-form-vue3'
import type { JsonSchema } from 'json-schema-form-vue3'

const schema = ref<JsonSchema>({
  type: 'object',
  properties: {
    tags: {
      type: 'array',
      title: 'Tags',
      items: {
        type: 'string'
      }
    },
    contacts: {
      type: 'array',
      title: 'Contacts',
      items: {
        type: 'object',
        properties: {
          name: {
            type: 'string',
            title: 'Name'
          },
          phone: {
            type: 'string',
            title: 'Phone'
          }
        }
      }
    }
  }
})
</script>

Development

Build from source:

git clone <repository-url>
cd json-schema-form-vue3
npm install
npm run build

For more information about Vue 3 TypeScript project setup, visit Vue Docs TypeScript Guide.