Spanish Total.js
English
Documentation For AI agents
Contents

Create a component

Write a new component in the built-in code editor.

.md GitHub
On this page

Create opens a code editor with the source of a small sample component, a clock. You change it into your own component.

The Edit source-code form with the sample component

Create a component

1. Select Import components at the top of the component list, and then Create.

2. Change the source. The lines at the top set how the component appears in the list:

  • exports.name: the name, for example 'Clock';
  • exports.group: the group in the list, for example 'Controls';
  • exports.icon: the icon, for example 'ti ti-clock'.

3. Select SUBMIT.

The component appears in the list under its group. Drag it onto the canvas like any other component.

The component is saved inside your design file. To use it in another design, export it. See Manage the component list.

Writing component code needs JavaScript. The official components are good examples.

Made in Europe