json-renderers-build

A simple guide to preparing JSON UI specifications

1. What Does It Do?

json-renderers-build is a headless specification compiler in the KeshavSoft declarative UI ecosystem.

It accepts a component type, data, and columns, then returns a JSON description of the requested UI. It does not create live DOM elements.

2. A Simple House-Building Story

json-renderers-build — The Architect

Chooses a component blueprint and prepares a JSON plan for the table, dropdown, or other supported UI.

json-transformer-funcs — The Helper Team

Functions such as fromCollection() turn lists of data into lists of JSON element descriptions based on templates.

json-to-tag — The Construction Worker

Reads the JSON element descriptions and creates real browser DOM elements.

json-renderers — The Site Manager

Mounts the generated elements in the correct webpage container.

These are story roles to make each repository responsibility easy to remember.

3. How They Work Together

Data + Columns→Build Specification→Create DOM→Mount on Page
  1. The application supplies data and a component type.
  2. json-renderers-build uses blueprints and json-to-spec to return a JSON specification AST.
  3. Reusable helpers from json-transformer-funcs, such as fromCollection(), can transform data collections into JSON element descriptions in relevant builders.
  4. json-to-tag creates the real DOM; json-renderers mounts it into the webpage.

4. Example: Build a Table Specification

import render from "json-renderers-build";
const records = [
  { name: "Ravi", city: "Kakinada" },
  { name: "Sita", city: "Visakhapatnam" }
];
const spec = render({
  type: "table",
  data: records,
  columns: [{ title: "Name" }, { title: "City" }]
});
console.log(spec);

The result is a JSON UI specification, not a rendered HTML table.

5. Supported Component Types

6. The Important Difference

json-renderers-build: prepares the JSON UI specification.

json-transformer-funcs: provides reusable data-to-JSON transformation helpers.

json-to-tag: creates real DOM elements from JSON descriptions.

json-renderers: mounts those elements into the webpage.

7. Official Documentation

json-renderers-build repository

json-transformer-funcs repository

json-renderers · json-to-tag

Live documentation

Why separate the steps? The JSON specification can be created without a browser DOM.

This makes specification building easier to test and reuse in different JavaScript environments.

For a dropdown, the template defines an option shape and the data supplies each option value.

For a table, the specification describes the table container, headings, rows, and cells.

The next stages consume the specification; they are responsible for actual DOM creation and mounting.

Use the repository README for version-specific APIs and setup instructions.

Simple flow: prepare the plan first, create the elements second, and place them last.