Share a component with the official repository
Prepare a component for the official repository and how the catalogue is built from it.
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
| Path | What it holds |
|---|---|
components/<id>/ | One folder for each component, with editor.html, render.html and settings.html. |
db.json | The catalogue. |
db.js | The script that builds db.json from the folders. |
cdn.js | The script that prepares the published files. |
Prepare your component
- Name the folder after
exports.id, in lowercase, for examplecomponents/stepper/. - Write each of
exports.id,exports.name,exports.group,exports.author,exports.icon,exports.version,exports.color,exports.typeandexports.floatingthat you use on one line that ends with a semicolon. The scripts read these lines one by one. - Write a
<readme>ineditor.html. It is copied into the catalogue and shown under Read me. - Put your name in
exports.author. - Use
exports.render = 'auto'andexports.settings = 'auto'withrender.htmlandsettings.html. - Refer to files of the component as
/components/<id>/<file>. - 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.jscdn.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.htmlOffer 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.