> For the complete documentation index, see [llms.txt](https://docs.aitheon.com/creators-studio/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aitheon.com/creators-studio/new-component-creation-tutorial/your-first-component.md).

# Your First Component

Make a simple component to get acquainted with the flow.&#x20;

## Create a Project

Open Creators Studio and create a **New Project**. Give it a **name** and write a **summary**. &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXGK-gGxgGCVEhD2MV-%2F-MXGy8lP77WcUUc2ZKOX%2FmyComponent.png?alt=media\&token=368ba911-2aa1-43d9-b4e6-e4e2b1a284f2)

Then choose **My Component** from the list of projects and open in a **Basic** sandbox. &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXGK-gGxgGCVEhD2MV-%2F-MXGzJ1fYjICn0b8k1oH%2Fopen%20project.png?alt=media\&token=7aadddbc-b905-4e53-bc5b-2b76324406b3)

## Edit the Structure

Expand the my-component folder on the workspace and you will see the folder structure of the template project.  &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXH-cyagAwgzZR7Shs1%2F-MXH-sAbFrhK50r9NHHf%2Fstructure.png?alt=media\&token=7f20866e-5b9a-450c-9f44-8ca13701891a)

We have two components here: a UI component (this is a simple **example-button** that sends input massage to output without changes) and a functional component (**example-uppercase** converts input string to uppercase).

Click **app-component.json** and you will see how these components look like and behave on the Apps Editor table and on UI preview. &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXH-cyagAwgzZR7Shs1%2F-MXH0hP7dywMAoP-3LOW%2Faap-component.png?alt=media\&token=a2079454-1533-4e0d-86c5-e9bd4b7c7364)

You see the flow: a UI **input-string** element that on the preview takes a string, then the UI **example-button** that sends this string to the **example-uppercase** (without UI), and the result goes to the UI **output**.

{% hint style="info" %}
Note: you can adjust the UI **Layouts** with the **EDIT WIDGECTS** button. Click **SAVE** after editing.
{% endhint %}

Rename the components' folders and files in subfolders to make the project clearer. Let it be **pass-button** and **lowercase** as far as we a going to save the button function (just to pass the message) and change the non-ui component function. Right-click on folders and files and rename them. &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXH9G_TKRWiphwevmr-%2F-MXH9MoUiUe-1nDjAOhI%2Fupdate%20names.png?alt=media\&token=72164c76-e2bc-442b-ba37-9da14d2b6fd7)

As you can see, we didn't change the icons file names. That's because we are going to replace them completely.

## Edit config.json

All the project structure is registered here. &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXH9G_TKRWiphwevmr-%2F-MXHAVgfbeqUSzlXFFOZ%2Fconfig.png?alt=media\&token=8515f8fe-e0bb-4c3c-8ad1-f9b00a22b0b8)

Update the folders and file names. &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXH9G_TKRWiphwevmr-%2F-MXHAaD2wPi-Gw6-z7p3%2Fupd%20config.png?alt=media\&token=98c8505a-fc65-415d-ac6d-2b95e6464761)

## Edit component.js

The button will remain a **pass-button**, so we're not going to change its function in the **pass-button.js** file.

But we have to change the function of **example-uppercase** to make it **lowercase**.  &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXH9G_TKRWiphwevmr-%2F-MXHC6KQOyyJOER7xmAx%2Flowercase.png?alt=media\&token=7598f2eb-c950-4159-945a-4960e039bc59)

Change the **toUpperCase()** method to **toLowerCase()** first. Rename the **TemplateNode** function to **LowercaseComponent**.&#x20;

Then don't forget to change the name we use to register the project components in **config.js** from **example-uppercase** to **lowercase**.  &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXH9G_TKRWiphwevmr-%2F-MXHCBC6VA4YjYYnPGUe%2Fupd%20lowercase.png?alt=media\&token=5e207c72-3972-44b7-a64e-971eac41d11b)

And don't forget to update the **function** name, the **registerType** name, and the **name** value in the **control** object of **pass-button.js** as well.  &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXH9G_TKRWiphwevmr-%2F-MXHDQdFJ3X-gUorCH3q%2Fupd%20pass-button.png?alt=media\&token=b70a5f4a-de4c-4d60-a06c-4d231b9dcd28)

{% hint style="info" %}
After updating the project's files you can test the result any time by pressing Apply Changes in the **app-component.json** file testing interface. Make sure you replaced obsolete **example-button** and **example-uppercase** on the workspace with updated components from the palette.
{% endhint %}

## Edit ui/component.vue and styles.scss

Apps Editor uses Vue.js to build UI components.&#x20;

We can change the behavior and appearance of **pass-button**'s UI in the **pass-button.vue** file.

The .vue file consists of three parts. We will not change&#x20;

```
<template> 
    <!-- all the markup structure and logic of the component -->
</template>    
```

and&#x20;

```
<script>
    // all of the non-display logic of the component
</script>
```

Change the color of **pass-button** in the **styles.scss** from **`#67b231`** to **blue** or any other you like.   &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXH9G_TKRWiphwevmr-%2F-MXHETEygCSa56Xum579%2Fbutton%20color.png?alt=media\&token=1dc646bd-4660-4546-8d81-444ef9fc502e)

## Edit component.html

Let's change the properties of components for Apps Builder.

### Main Definitions

In the first **`<script> </script>`** block change some definitions that are registered with the editor. &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXH9G_TKRWiphwevmr-%2F-MXHFW_uohi8EqYmzYqD%2Flowercase-html.png?alt=media\&token=4e1fe557-d566-4673-8b9f-567a900437a7)

* First, update the component registerType and label **(1)**. The label shows the component\`s name on the editor table.
* Change the component's category on the palette to **custom** (or any you want) **(2)**.
* Change the components color in the editor **(3)**. Since this is the function-like component, use the **#8c58e9** color for it.
* Change the icon **(4)** for the editor view. You can drag-and-drop your own icon file to the icon folder and use it. In this case, let's use [Font Awesome](https://fontawesome.com/v4.7.0/icons/) link for an icon. For example, **fa-arrow-down**.&#x20;
* At last, add the line **`paletteLabel: 'lowercase',`** (after the **`icon`** line, for example) **(5):** &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXHFlRF8V0sBuqivEmm%2F-MXHGuPlydkAmyG0uXQ2%2Flower-html%20upd.png?alt=media\&token=ba3d1104-b2ff-40b8-a92d-b17171eb8981)

{% hint style="info" %}
Open **app-component.json** and Apply Changes to check if everything is as expected.
{% endhint %}

And don't forget to make appropriate changes in **pass-button.html**.&#x20;

### Edit Template

When you double-click on a component on the workspace of Apps Editor you can change its properties. We can update this window's appearance in the second **`<script> </script>`** block.

Double-click on your lowercase component to view how it looks like in Apps Editor.  As we haven't updated the properties block yet (it's still referring to **example-uppercase**), here we see nothing.&#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXHJY10p5fDcbamzGvP%2F-MXHKOorq-Rxmu5cudOG%2Fcomponent%20props.png?alt=media\&token=30b6e259-3da0-48dc-89ba-ebc380dc1857)

The entire properties appearance block must be named as the component **(4)**.

The first property is displayed with an icon **(2)**, property name **(3)**, and an input field with a placeholder **(4)**.&#x20;

Update **lowercase.html**:  &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXHLofsyQXOl_Mvpvrf%2F-MXHQxmSZH81SLwMO_Q4%2Flowercase%20props.png?alt=media\&token=e1f30f21-dae7-4038-89dc-017ab2a7e2e0)

Update the name of the block **(1)** to match the registering name.

Change the icon **(2)** to **fa fa-check**, the property name **(3)** to **Label**, the placeholder **(4)** to **Type the Name here**. Then copy and past couple of `<div> </div>` blocks from the second **`<script> </script>`** part of **pass-button.html** just for fun.&#x20;

Don't forget to update the **data-template-name** value **(1)** in **pass-button.html** to match the registering name.

Apply changes. Check the **pass-button** component properties, then **lowercase** properties.

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXHLofsyQXOl_Mvpvrf%2F-MXHTOdqbsxDkBaoGqnV%2Fupd%20lowercase%20props.png?alt=media\&token=13e50c22-ff81-4a93-919b-255f4d424c2f)

{% hint style="info" %}
Note that the two new properties that we added are not functional. To make them functional you have to update the **Main Definitions** the **.js** file accordingly.
{% endhint %}

### Help Text

In the third **`<script> </script>`** block update the description of the component function and the block name. Our component lowers the characters.  &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXHLofsyQXOl_Mvpvrf%2F-MXHU1n-50K4Yn0E66pw%2Flowercase%20help.png?alt=media\&token=0847bf18-c787-4b4f-a902-a44cbb6c86f6)

The result will be:  &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXHLofsyQXOl_Mvpvrf%2F-MXHUpJm2zJ88Su387Aj%2Flowercase%20help%20upd.png?alt=media\&token=d3db346b-ce23-47a7-947d-3620a2702dad)

{% hint style="info" %}
Don't forget about **pass-button** Help!
{% endhint %}

## Test the Component

A testing tool is embedded in the template. Click **app-component.json** to open the testing flow and UI previewer. After you changed the components' registering names the template components on the workspace are obsolete. Replace them with new **pass-button** and **lowercase** components (if you haven't done it yet), connect and set up them and click **Deploy**.&#x20;

Now you are able to test the components in the workspace and UI previewer.&#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MVWwxhWhWaJIvXGluFL%2F-MVWxl-BXb-pAewjMWEc%2Ftest.png?alt=media\&token=77824041-0c8e-43ff-a8b0-98fb7f8bbe1d)

## Make a Release

### Make a Quick Release

When everything looks and works right we are ready to make a release and use the components in other projects. &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXHVONUEYmy5cRXjyyS%2F-MXHX1DGkwYnRKCg2yPo%2Frelease.png?alt=media\&token=24bf6dc0-aca4-4580-9322-a9773e643e3a)

Click **Quick Release (1)**, choose the project, and release it. After that open **Quick Release Status (2)** and wait till the status become **Completed**.&#x20;

{% hint style="info" %}
The Quick Release method gives the number and name to the release automatically. To do this manually make an ordinary **Release** with **Build** stage.&#x20;
{% endhint %}

### Create an App Project

To use the components open o create a new application project. Choose AOS Cloud Runtime and Dashboard type.&#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MVWxq9jDcTalw7IDdnP%2F-MVX0QyHdXu7j2s45qx2%2Fnew%20app%20project.png?alt=media\&token=2b439671-03bc-4427-9b97-6ec4b17a1a7c)

Open this project and click **Install Component**.&#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MVWxq9jDcTalw7IDdnP%2F-MVX1aemX9W8Wj_mUMlW%2Finstall.png?alt=media\&token=6878e9fa-3e48-412e-9ad8-0de4a5102429)

Choose the **Project to install** and the **Release version**, then click **Install**. &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXHVONUEYmy5cRXjyyS%2F-MXHY8Rzeja6stO_PNmf%2Finstall%20component.png?alt=media\&token=a80ee618-3e72-4697-a2e9-d9bc9bc8009c)

Reload the page and new components will appear on the palette.  &#x20;

![](https://3983587133-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LvAp4NFmv7Cj5kJvKjw%2F-MXHVONUEYmy5cRXjyyS%2F-MXHYlTZqA1g0RA0Y_sl%2Fcustom%20palette.png?alt=media\&token=aa4dcd5c-c3e6-4393-9a5c-443ccc9a0d41)

## Put it to the Marketplace

The components are available for you to use in any app project. To share them with other organizations publish them on the Marketplace. View [**this tutorial**](/creators-studio/publish-an-app.md).

{% hint style="info" %}
But please don't publish this particular project on the Marketplace. Make a new valuable one first.
{% endhint %}
