---
title: Your first component
project: Flow
version: 11.1
section: development
language: en
license: MIT
url: https://totaljs.es/docs/flow/11-1/development/first-component/
updated: 2026-11-19T10:58:45.178Z
---

# Your first component

> Create a component in the designer, use it in a FlowStream and install it from a file.

This page builds **Uppercase**, a component that turns the text it receives into capital letters, and runs it between a **Trigger** and a **Print** node.

## Create the component

1. Open a FlowStream in the designer.
2. Select **Add** (plus), then **Create new component**.
3. The **Source code** window opens with a template of a component.

![The Source code window with the template of a new component](/files/JapyVt5ME61f.webp)

4. Replace the whole template with this code:

```html
<script total>

	exports.id = 'uppercase';
	exports.name = 'Uppercase';
	exports.icon = 'ti ti-font';
	exports.author = 'Jane Doe';
	exports.version = '1';
	exports.group = 'Demo';
	exports.config = {};
	exports.inputs = [{ id: 'input', name: 'Input' }];
	exports.outputs = [{ id: 'output', name: 'Output' }];

	exports.make = function(instance, config) {

		instance.message = function($) {
			$.send('output', String($.data).toUpperCase());
		};

	};

</script>

<readme>
Converts the incoming data to uppercase text.
</readme>

<body>
	<header>
		<i class="$ICON"></i>$NAME
	</header>
</body>
```

5. Select **APPLY**.

**Uppercase** appears in the list of components on the left, in the **Demo** group.

## Use it

1. Download **Trigger** and **Print** if the FlowStream does not have them. See [Download components](/flow/11-1/guides/download-components/).
2. Drag **Trigger**, **Uppercase** and **Print** onto the canvas and connect them in this order. See [Add and connect nodes](/flow/11-1/guides/connect-nodes/).
3. Configure the **Trigger** node: clear **Random data** and type `hello flow` in **Data**.
4. Select **APPLY** in the toolbar to start the design.
5. Select **Run** on the **Trigger** node.

**Print** shows `HELLO FLOW`.

![Trigger, Uppercase and Print connected, with HELLO FLOW in the Print node](/files/JapyVv5NE60f.webp)

## What the code does

- `exports.id`, `exports.name`, `exports.icon` and the other properties describe the component.
- `exports.inputs` and `exports.outputs` create the connection points of the node.
- Flow calls `exports.make` once for each node. It receives the `instance` of the node and its `config`.
- Flow calls `instance.message` for every message that arrives. `$` is the message, `$.data` its data.
- `$.send('output', ...)` sends new data to the output with the id `output`.

## Change the component

1. Right-click the **Uppercase** node and select **Edit source code**.
2. Change the code and select **APPLY**.

Flow replaces the component in this FlowStream and restarts its nodes with the new code.

## Install it from a file

Save the code as `uppercase.html` on a web server. In another FlowStream, select **Add**, then **Link component**, and enter the address of the file. See [Install a component from a URL](/flow/11-1/guides/link-component/).

To offer many components to your team, publish them in [your own catalogue](../own-catalogue/).
