# Input Types

These are the current allowed **Input Types:**

* **​**[**Text String**](https://documentation.alpaco.email/template/input-groups/input-types/text-string)

  \- A single line of text with no formatting options.
* [**Textarea**](https://documentation.alpaco.email/template/input-groups/input-types/textarea)

  \- Multi-line text input with simple formatting options.
* **​**[**Select**](https://documentation.alpaco.email/template/input-groups/input-types/select)

  \- Select/Dropdown of predefined values.
* **​**[**Boolean**](https://documentation.alpaco.email/template/input-groups/input-types/boolean)

  \- On/off toggle/switch.
* [**​Image**](https://documentation.alpaco.email/template/input-groups/input-types/image)

  \- Image upload or URL input.
* **​**[**Color picker**](https://documentation.alpaco.email/template/input-groups/input-types/color-picker)

  \- Color picking wheel w/ eyedrop tool.
* [**​Code**](https://documentation.alpaco.email/template/input-groups/input-types/code)

  \- Ability to insert raw code.

### How to get started?

Simply open up your [Base](https://documentation.alpaco.email/template/base) or [Block](https://documentation.alpaco.email/template/blocks), depending on where you want your input, navigate to the Right panel, click the button called "**Add input**" and select your input type from the dropdown.\
Just like with [Input Groups](https://documentation.alpaco.email/template/input-groups/..#input-group), the **Name** and **Key** needs to be inserted and given a proper name.

{% hint style="info" %}
Notice the tag below the name, that's generated when you give your input a **Key.** Putting your cursor in the center panel and clicking the tag in the right panel will automatically insert the tag with correctly formatted syntax in the center panel for you.
{% endhint %}

<figure><img src="https://4158541773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUZwvCYi7VuSyayWGoc6M%2Fuploads%2FWzBYKNdINsvC8tvUBAbN%2FSk%C3%A6rmbillede%202023-10-04%20135513.png?alt=media&#x26;token=77d596aa-b1e8-400b-8176-962bb50ba4c5" alt=""><figcaption></figcaption></figure>

### Validate Inputs

Validating inputs and give warnings is an essential part of handing over your template to others users. By using validation rules you can add clarity to what the intended use for an input should be.\
\
All Input types have a dropdown option in the Template Editor where multiple validation rules can be added and they all come with an option to make a Custom Error Message per validation rule, for each input field.&#x20;

<figure><img src="https://4158541773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUZwvCYi7VuSyayWGoc6M%2Fuploads%2F6AWP8eXNg4C81dOCGzQ6%2FSk%C3%A6rmbillede%202025-10-21%20163005.png?alt=media&#x26;token=74aec2f7-6302-4343-96ca-3e0bd72ba6ff" alt=""><figcaption><p>In the image we see two Validations types, Required Field and Maximum Length set to 25 characters, has been added to a Text String</p></figcaption></figure>

If an input is not validated in the Email Editor, the user will be informed of the error, taken to where the error is, have the error highlighted and prevented from saving the email before adhering to the specific input requirement.

<figure><img src="https://4158541773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUZwvCYi7VuSyayWGoc6M%2Fuploads%2FIKvQnFfjptHFAmxDdREB%2FSk%C3%A6rmbillede%202025-10-21%20164832.png?alt=media&#x26;token=5c714e5d-dd6f-4a66-831f-a532052d8d63" alt=""><figcaption><p>Here we see a validation rule trigger, showcasing the error message, highlighting and prevention of saving</p></figcaption></figure>

<table><thead><tr><th valign="top">Validation types</th><th valign="top">Description</th><th valign="top">Applicable in Input type</th></tr></thead><tbody><tr><td valign="top"><strong>Required field</strong></td><td valign="top">This field must be blank</td><td valign="top"><strong>​</strong><a href="input-types/text-string"><strong>Text String</strong></a><br><a href="input-types/textarea"><strong>Textarea</strong></a><br><strong>​</strong><a href="input-types/select"><strong>Select</strong></a><br><strong>​</strong><a href="input-types/boolean"><strong>Boolean</strong></a><br><a href="input-types/image"><strong>​Image</strong></a><br><strong>​</strong><a href="input-types/color-picker"><strong>Color picker</strong></a><br><a href="input-types/code"><strong>​Code</strong></a></td></tr><tr><td valign="top"><strong>Must Not Be Default</strong></td><td valign="top">This field must not be indentical to the default content</td><td valign="top"><strong>​</strong><a href="input-types/text-string"><strong>Text String</strong></a><br><a href="input-types/textarea"><strong>Textarea</strong></a><br><strong>​</strong><a href="input-types/select"><strong>Select</strong></a><br><strong>​</strong><a href="input-types/boolean"><strong>Boolean</strong></a><br><a href="input-types/image"><strong>​Image</strong></a><br><strong>​</strong><a href="input-types/color-picker"><strong>Color picker</strong></a><br><a href="input-types/code"><strong>​Code</strong></a></td></tr><tr><td valign="top"><strong>Maximum Length</strong></td><td valign="top">This field may contain X amount of characters</td><td valign="top"><strong>​</strong><a href="input-types/text-string"><strong>Text String</strong></a><br><a href="input-types/textarea"><strong>Textarea</strong></a></td></tr><tr><td valign="top"><strong>Minimum Length</strong></td><td valign="top">This field must be at least X amount of characters</td><td valign="top"><strong>​</strong><a href="input-types/text-string"><strong>Text String</strong></a><br><a href="input-types/textarea"><strong>Textarea</strong></a></td></tr><tr><td valign="top"><strong>Regex</strong></td><td valign="top">Define any form of regular expression you want. Be that URL, numbers, wordings ect.</td><td valign="top"><strong>​</strong><a href="input-types/text-string"><strong>Text String</strong></a><br><a href="input-types/textarea"><strong>Textarea</strong></a></td></tr></tbody></table>

### Show or hide

When building your Email Design system, over time it can become very crowded with fields and options for the users to fill in. However many times fields are dependent on each other, and is useless  without the other - in these cases you want to hide those uncessary fields.\
\
That's where the **if/unless** **field** come in handy on Inputs. You'll be able to hide or show any input types by typing in a liquid condition in accompanying if/unless field. The liquid condition could be coming either internally from the [Block](https://documentation.alpaco.email/template/blocks) or even from [Cross reference inputs](#cross-reference-inputs).

<figure><img src="https://4158541773-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUZwvCYi7VuSyayWGoc6M%2Fuploads%2FEZGH8YfguWHQBGekwlav%2FSk%C3%A6rmbillede%202026-02-04%20101022.png?alt=media&#x26;token=cf4fb493-0af4-40f2-a996-57ef40372d29" alt=""><figcaption><p>Notice the if statement on Button link in the right-hand side, is now dependent on the input called Button text is not empty.</p></figcaption></figure>

The syntax is a bit deconstructed in so far as you're not suppose to write the entire liquid statement with the proper opening and closing tag, eg. *{%if \*YOUR STATEMENT\*%}{%endif %}* as the platform will be doing that for you. Simply type in the liquid condition however complex you may need. \
You're able to use if or unless as your initial condition.
