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 🙏

© 2025 – Pkg Stats / Ryan Hefner

vanjs-jsf

v0.0.19

Published

A JSON Schema Form UI Library for VanJS

Readme

📦 VanJS-JSF a JSON Schema Form Library for VanJS

Generate dynamic UI forms effortlessly with TypeScript and JSON Schema, powered by the JSON Schema Form Headless UI framework.

Description

This library aims to provide a robust and flexible solution for dynamically generating user interface (UI) forms using JSON Schema definitions. It is built on TypeScript for type safety and leverages the powerful JSON Schema Form Headless UI framework, which you can find documented here. It ensures a lightweight, modern, accessible, and customizable form-building experience.

Features to implement

  • [ ] Dynamic Form Generation: Create forms directly from JSON Schema, reducing repetitive coding tasks.
  • [ ] Customizable: Tailor form styles, layouts, and behaviours to meet specific UI/UX requirements.
  • [ ] Headless UI Integration: Utilize Headless UI's components for accessible and modern interfaces.
  • [ ] TypeScript-first Approach: Enjoy strong typing and enhanced developer experience with TypeScript.
  • [ ] Validation Support: Easily integrate JSON Schema-based validation for seamless user input handling.
  • [ ] Extensible Architecture: Add custom widgets, field types, and behaviours as needed.

Available components

The currently supported form element types are:

  • text = "text",
  • number = "number",
  • textarea = "textarea",
  • select = "select",
  • radio = "radio",
  • date = "date",
  • fieldset = "fieldset"

Use Cases

  • Quickly generate forms for dashboards, admin panels, and dynamic web applications.
  • Prototype or test form-based UIs with minimal setup.
  • Build reusable form components for your projects.

Getting Started

  1. Install the library:

We're working on publishing the library in the nmp repository.

npm install vanjs-jsf
  1. Import it in your project & define your JSON schema + config:
import { jsform } from 'vanjs-jsf';

const schema = {
  type: 'object',
  properties: {
    userName: { type: 'string', title: 'Name' },
    age: { type: 'number', title: 'Age' },
  },
};

// Initial values to fill the form
const initialValues = { userName: "Simon" };
// JSON Schema Form config
const config = {
  strictInputType: false,
  initialValues: initialValues,
  formValues: initialValues,
};
  1. Render the form using VanJS UI framework & handle form submit.

This library will call the onsubmit handler set using the VanJS props passing the original source event.

const handleOnSubmit = (e: Event) => {
  e.preventDefault();
  const values = jsfConfig.formValues;
  alert(`Submitted successfully: ${JSON.stringify(values, null, 2)}`);
  console.log("Submitted!", values);
};

 // Add the JSON Schema Form to an VanJS element 
div(
    h1("json-schema-form + VanJS"),
    p("This demo uses VanJS without any other form library."),
    jsform(
      {
        name: "my-jsf-form",
        schema: schema, // JSON Schema defined previously
        config: config, // JSON Schema Form configuration
        onsubmit: handleOnSubmit,
      },
      button({ type: "submit" }, "Submit")
    )
  );

Contributing

Contributions are welcome! Please submit a pull request if you have ideas, feedback, or improvements. Your contributions will help make this library more robust and useful for the community.

License

This project is licensed under the Apache 2 License. For details, see the LICENSE file.