Spanish Total.js
English
Documentation For AI agents
Contents

Share a component with the official repository

Prepare a component for the official repository and how the catalogue is built from it.

.md GitHub
On this page

The official components live in the public GitHub repository totaljs/uibuildercomponents. When your component is useful to others, you can offer it there, and after it is accepted it appears in Import components of every UI Builder.

How the repository is organized

PathWhat it holds
components/<id>/One folder for each component, with editor.html, render.html and settings.html.
db.jsonThe catalogue.
db.jsThe script that builds db.json from the folders.
cdn.jsThe script that prepares the published files.

Prepare your component

  1. Name the folder after exports.id, in lowercase, for example components/stepper/.
  2. Write each of exports.id, exports.name, exports.group, exports.author, exports.icon, exports.version, exports.color, exports.type and exports.floating that you use on one line that ends with a semicolon. The scripts read these lines one by one.
  3. Write a <readme> in editor.html. It is copied into the catalogue and shown under Read me.
  4. Put your name in exports.author.
  5. Use exports.render = 'auto' and exports.settings = 'auto' with render.html and settings.html.
  6. Refer to files of the component as /components/<id>/<file>.
  7. Follow the coding standards that the repository links in its README.

How the catalogue is built

db.js reads editor.html of every folder and writes db.json, sorted by name. Run it from the repository folder after npm install total4:

node db.js

cdn.js prepares the published files: it copies the folders, changes the paths /components/<id>/ to the published address, and writes the catalogue with type and floating. It also writes the lists of the templates: app.json and dashboard.json with the components that have no type or name that type, and flowboard.json with the floating ones and those of type flowboard.

The published address of a component is:

https://cdn.componentator.com/uibuilder/<id>/editor.html

Offer it

Fork the repository on GitHub, add your component folder on a branch, and open a pull request with a short description of what the component does.

Change a component later

Raise exports.version with every change, so that users can see which version they have.

Made in Europe