# Inputs

Input fields are essential building blocks of almost any application. Such fields target specific types of content, like simple text, numbers, passwords or dates. For this purpose, Uify offers many different input field components targeting those different content types.

Due to similarities in their UI/UX, those components have many configuration properties and API fields in common, but expose a few custom properties that are specific to their particular functionality. This page introduces all input components by describing the shared properties first, and then covering the specific properties of each component separately.

### Input types

The most basic input field is a simple **Text Input**. It allows to enter single-line text without any line breaks and is perfectly suited for short inputs like names, street names, etc.

<figure><img src="https://1582137130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkTYtq8XZyg79paoHbd93%2Fuploads%2FDobHTihBcnOCFLkT9U9q%2FScreen%20Cast%202022-11-25%20at%204.54.44%20PM.gif?alt=media&#x26;token=23ae721f-7cd3-4eac-9943-343f4d79a3fb" alt=""><figcaption><p>Text input</p></figcaption></figure>

In case single-line text is not suitable and a larger amount of text should be entered, the **Textarea** is a better fit. It allows to display more than one line of text and to enter line breaks as well:

<figure><img src="https://1582137130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkTYtq8XZyg79paoHbd93%2Fuploads%2FqG33vMqo3NCYAOuF2fvm%2FScreen%20Cast%202022-11-25%20at%203.59.10%20PM.gif?alt=media&#x26;token=497364d6-0317-4d38-8ab4-7b416e3dd78e" alt=""><figcaption><p>Textarea</p></figcaption></figure>

A more specific type of inputs is the **Password Input**. It hides the input, unless the user deliberately decides to make the entered value visible by clicking on the icon on the right:

<figure><img src="https://1582137130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkTYtq8XZyg79paoHbd93%2Fuploads%2FzwoAaDGdXSoyeRBUBQgq%2FScreen%20Cast%202022-12-04%20at%203.14.41%20PM.gif?alt=media&#x26;token=703adf8f-a85c-4f95-97dd-f7dfe3c54e15" alt=""><figcaption><p>Password Input</p></figcaption></figure>

Another specialized input type is the **Number Input**. It accepts numeric input only, and can be configured to accept negative values and decimal values. The arrow buttons on the right allow incrementing or decrementing the input value by mouse click:

<figure><img src="https://1582137130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkTYtq8XZyg79paoHbd93%2Fuploads%2F8arkHB2j6EpbUl1fx66F%2FScreen%20Cast%202022-12-04%20at%203.17.18%20PM.gif?alt=media&#x26;token=44f8d6ab-01b4-4f1d-85fb-1dff42d119c9" alt=""><figcaption><p>Number Input</p></figcaption></figure>

Another number-based input is the **Percent Input**. It offers the same UX and functionality of the Number Input, but auto-appends the percentage sign. The `value` of this input is exposed as decimal value, for example "25%" will be programmatically exposed as the decimal 0.25:

<figure><img src="https://1582137130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkTYtq8XZyg79paoHbd93%2Fuploads%2Fm2BJk0B94QMUEjIXVqzq%2FScreen%20Cast%202022-12-04%20at%203.20.18%20PM.gif?alt=media&#x26;token=1bd580ed-9074-4198-9f47-dc96aa20ab17" alt=""><figcaption><p>Percent Input</p></figcaption></figure>

The **Email Input** and **URL Input** are standard text inputs, but validate the entered value for correctness:

<figure><img src="https://1582137130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkTYtq8XZyg79paoHbd93%2Fuploads%2FmZjJoDOGQMOQabMUeInp%2FScreen%20Cast%202022-12-04%20at%203.35.34%20PM.gif?alt=media&#x26;token=07a189f5-9b63-4ef2-b196-4ca07561199a" alt=""><figcaption><p>Email and URL Input</p></figcaption></figure>

The **Slider Input** is an intuitive way to quickly set a value within a range with a certain step size without the need to type a numerical value:

<figure><img src="https://1582137130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkTYtq8XZyg79paoHbd93%2Fuploads%2FSjTWfgikt4D3yxvIjXvn%2FScreen%20Cast%202023-03-01%20at%205.18.48%20PM.gif?alt=media&#x26;token=e87bdcaf-72b0-4a80-a8cd-a16e85d7156d" alt=""><figcaption><p>Slider Input</p></figcaption></figure>

The **File Input** allows users to upload a digital file from their device to be used by an appropriate endpoint:

<figure><img src="https://1582137130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkTYtq8XZyg79paoHbd93%2Fuploads%2F7wPcHwgaO7ePdPpwBhKD%2FScreen%20Cast%202023-03-15%20at%2010.56.39%20AM.gif?alt=media&#x26;token=41949462-e0a8-4b28-be45-f7e0b030fe81" alt=""><figcaption></figcaption></figure>

Last but not least, the **Date Input**, **Time Input,** **Date & Time and Date Range Input** allow the user to enter temporal values. The format is fully configurable and convenient date- and time-pickers make it easy to find the right value. A manual entry and adjustment of the value is possible as well:

<figure><img src="https://1582137130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkTYtq8XZyg79paoHbd93%2Fuploads%2Fl43m5ROsgrLkQ0K8vBE2%2FScreen%20Cast%202023-03-01%20at%205.09.29%20PM.gif?alt=media&#x26;token=f4219b34-0578-4915-b3fa-8e24c21f106c" alt=""><figcaption><p>Date, Time, Date &#x26; Time and Date Range Inputs</p></figcaption></figure>

In case the user enters a value that is not a valid date or time, according to the configured format, the value is set to the current date and/or time when the input loses focus. This guarantees that if the input contains a value, it will always be valid:

<figure><img src="https://1582137130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkTYtq8XZyg79paoHbd93%2Fuploads%2F2zuGKPwrJzZ0bbKRpeeG%2FScreen%20Cast%202022-12-04%20at%204.46.16%20PM.gif?alt=media&#x26;token=2ec79f82-6151-4152-8e0b-b393fa162aed" alt=""><figcaption><p>Handling invalid input</p></figcaption></figure>

### Label positioning

There are two options where the input label can be positioned: To the left of the input, or on top of it. This is automatically adjusted based on the size of the component. The label will be placed above the input as soon as there is enough space for it. Otherwise, the label is positioned to the left of the input in the same line. All inputs except the Textarea will never expand beyond a single line of input. Since the Textarea may contain multi-line content though, it will take the remaining vertical space of the component entirely:

<figure><img src="https://1582137130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkTYtq8XZyg79paoHbd93%2Fuploads%2FDFplU4q2xgZtEiNLze5d%2FScreen%20Cast%202022-12-04%20at%203.47.03%20PM.gif?alt=media&#x26;token=02c39b0a-5d99-49b1-9307-bd74722e4fed" alt=""><figcaption><p>Label position is determined by component size automatically</p></figcaption></figure>

### Switching types

You may change the type of an existing input component by changing the "Input type" property in the properties panel. This will have the following effects on the configured properties of the input component:

1. Values of properties that both input types have in common (e.g. the "Disabled" property) will remain the same.
2. Values of properties that do not exist in the target input type (e.g. the "Allow decimals" property of a Numbers Input, which does not exist for the Text Input) will be discarded.
3. Existing validation rules will always be dropped entirely.
4. When switching to the Email Input or URL Input, the respective validation rules will be added.

{% hint style="info" %}
Due to effect 2. and 3., switching an input component to another type, and then back to the initial type, might not result in exactly the same property settings. Therefore, please be careful and aware of these effects when switching input types.
{% endhint %}

### Validation rules

Validating user input is a very common requirement in many applications. You may attach any of the predefined validation rules to input components, or you can create validation actions with custom logic yourself. These validation rules are managed in the properties panel. Some input types have validation rules pre-configured (e.g. the **Email Input** and the **URL Input**).

#### Validation trigger

One fundamental decision that you need to make: Should validation rules be applied on every key stroke (i.e. the user will receive immediate feedback while typing) or only on submit of a surrounding [Form](https://docs.uify.io/component-reference/form) component? This is configured via the "Validate while typing" property. Especially in case the validation is complex, for example because it involves interactions with external data sources, it is highly recommended to disable this setting. In case however you would like to validate an input component outside of a Form context, this setting should be enabled because the validation will otherwise never happen.

<figure><img src="https://1582137130-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkTYtq8XZyg79paoHbd93%2Fuploads%2FzDj4ZobJEFTE9B8QpwTu%2FScreen%20Cast%202022-12-04%20at%204.22.49%20PM.gif?alt=media&#x26;token=0411b69d-7a71-421a-b5dc-b5927a1983f0" alt=""><figcaption><p>Impact of the "Validate while typing" property</p></figcaption></figure>

#### Rule execution

In case an input has multiple rules configured, all rules are executed in parallel, not sequentially. This means, that all rules will always be executed and evaluation is not eagerly aborted in case one rule has already failed. Due to this execution model, the error message presented to the user will always include all messages from all failing validations.

#### "Required" validation

The "Required" property is a special kind of validation, because it is not listed among the validation rules. When this setting is enabled, an input without value is considered invalid when validations are triggered. Being "without value" has a different meaning for different input types:

* **Text, Textarea, Email, URL, Password**: These inputs are considered to not have a value when the length of the value is 0.
* **Number, Percent**: When these inputs do not contain at least one digit, they are considered to not have a value.
* **Date, Time, Date & Time, Date Range**: These inputs do not contain a value in case the input is cleared entirely. Since these inputs are filled with the current date and time in case the user enters an invalid value, this state is fairly well-defined.

This validation is triggered according to the same logic like other validation rules: When "Validate while typing" is enabled, this condition is checked on every change of the input value, otherwise only when a surrounding [Form](https://docs.uify.io/component-reference/form) is submitted.

#### Minimum length & Maximum length

These rules are available for all textual inputs: **Text**, **Textarea**, **Email**, **URL**, **Password**. They require the input value to have a minimum or maximum amount of characters to be valid. The constraint value is configured with a JavaScript input, i.e. the limit can contain dynamic code that will be evaluated before the validation rule is applied.

#### Minimum value & Maximum value

These rules are available for numeric inputs: **Number** and **Percent**. The limits are entered with a JavaScript input, i.e. it may be highly dynamic. In case of the percent input, the limit should be entered as a decimal value, e.g. a minimum or maximum of 25% should be entered as `0.25`, not as `25`.

#### Email

Available for **Text Input**, **Textarea** and **Email Input**. It requires the input value to be a valid email address. This validation rule is automatically added to instances of the **Email Input** component.

#### URL

Available for **Text Input**, **Textarea** and **URL Input**. This rule can be configured to require a specific protocol (for example, HTTP, HTTPS or FTP). If no protocol is configured, a URL without protocol prefix is accepted (e.g. `google.com`), otherwise the protocol prefix must be provided for the value to be accepted. In addition to this, a comma-separated list of accepted domains can be provided. In case the entered value is not among the configured domains, the value is considered to be invalid and a warning is presented to the user. The input for configuring these domains is a simple text input, but may contain dynamic JavaScript expressions with the `{{ ... }}` syntax.

This validation rule is automatically added to instances of the **URL Input** component.

#### Regular expression

Available for all textual inputs: **Text**, **Textarea**, **Email**, **URL**, **Password**. The input for the RegEx is a text input, which may contain dynamic JavaScript expressions with the `{{ ... }}` syntax. You may enter the pattern with or without `/`, but if you decide to include them, you need to include them both at the beginning and the end. You may add modifiers and the special indicators `^` and `$`, i.e. for example `/^\d+\sabc$/i` is a perfectly valid input.

#### Before, After, Before time, After time

Available for the textual inputs **Date**, **Time** and **Date\&Time**. These rules define that the entered date or time must be before or after the configured threshold. The threshold is entered with a JavaScript input, i.e. it is expected to always be a dynamic expression. It may evaluate to a JavaScript `Date`, like e.g. `new Date(2022, 11, 1)` or an ISO date string, like e.g. `'2022-12-01'`. The "Before time" and "After time" rules will also accept a time string in the format `HH:mm`, like e.g. `'14:33'`.

#### Custom action

This validation rule is available for all input types. The associated action will be executed every time the validation rules are evaluated ([see triggers](#validation-trigger)). The action execution will receive the current input value as [argument](https://docs.uify.io/writing-code/actions/execution-model#action-arguments), so that it is easily available for applying validation logic. The return value of the action will be used as follows:

* A falsy return value means that the value is not valid. The default error message will be shown to the user. Since `undefined` is considered falsy as well, custom validation actions should always return a value explicitly.
* A return value of type `string` will be used as custom error message. In this case, the value will be considered invalid, and the returned string will be displayed to the user as error message. Please note that the empty string is falsy, and will hence mean an invalid value. The default error message will be shown to the user in this case.
* A truthy return value, except for a value of type `string`, means that the input value is valid.
* In case the action throws an error, the value is considered invalid and a default error message is shown accordingly.

### Properties

All input components share the following set of configuration properties:

<table><thead><tr><th width="158">Property</th><th width="159">Type</th><th width="161">Default value</th><th>Behavior</th></tr></thead><tbody><tr><td>Disabled</td><td><code>boolean</code></td><td><code>false</code></td><td>Determines whether the input is disabled or not. When disabled, the user cannot focus the input and cannot modify the value. Validation rules are however applied either way.</td></tr><tr><td>Input type</td><td><code>string</code></td><td>Depends on input type</td><td>This property is used to switch an input to another type. <a href="#switching-types">Learn more</a></td></tr><tr><td>Label</td><td><code>stringWithJs</code></td><td>Depends on input type</td><td>Text that is displayed as label of the input, either to its left or above. <a href="#label-positioning">Learn more</a></td></tr><tr><td>Label alignment</td><td><code>'left' | 'center' | 'right'</code></td><td><code>'left'</code></td><td>Text alignment of the label.</td></tr><tr><td>Required</td><td><code>boolean</code></td><td><code>false</code></td><td>Determines whether the input is considered invalid without a value. Learn more about this special kind of validation rules <a href="#required-validation">here</a></td></tr><tr><td>Validate while typing</td><td><code>boolean</code></td><td><code>true</code></td><td>Determines whether the validation rules should be evaluated on every change of the input value, or only on surrounding <a href="form">Form</a> submit. <a href="#validation-trigger">Learn more</a></td></tr><tr><td>Validation rules</td><td>List</td><td>None, except for <strong>Email Input</strong> and <strong>URL Input</strong></td><td>Set of validation rules that are applied on the configured trigger. <a href="#validation-rules">Learn more</a></td></tr></tbody></table>

#### Custom properties of textual inputs

This includes the **Text Input**, **Textarea**, **Password Input**, **Email Input** and **URL Input**:

<table><thead><tr><th width="158">Property</th><th width="159">Type</th><th width="161">Default value</th><th>Behavior</th></tr></thead><tbody><tr><td>Default value</td><td><code>stringWithJs</code></td><td><code>''</code></td><td>Initital value of the input on app load. Also, this value is set when the <code>reset()</code> API method of the input, or a surrounding <a href="form">Form</a>, is triggered.</td></tr><tr><td>Placeholder</td><td><code>stringWithJs</code></td><td><code>'Enter value' | 'Enter password'</code></td><td>Text that is displayed in the input when no value has been entered yet.</td></tr><tr><td>Show clear icon</td><td><code>boolean</code></td><td><code>false</code></td><td>Determines whether an "x" icon will be shown when a value has been entered. Clicking this icon will clear the input entirely. Does not apply to <strong>Password Input</strong> and <strong>Textarea</strong>.</td></tr></tbody></table>

#### Custom properties of numeric inputs

This includes the **Number Input** and the **Percent Input**:

<table><thead><tr><th width="158">Property</th><th width="159">Type</th><th width="161">Default value</th><th>Behavior</th></tr></thead><tbody><tr><td>Allow decimals</td><td><code>boolean</code></td><td><code>false</code></td><td>Determines whether the user may enter decimal values. The decimal separator is always the dot (<code>.</code>). This setting also influences how pasting works - in case this setting is set to <code>false</code>, the decimal point and potential decimals will be cut off when pasted.</td></tr><tr><td>Allow negative</td><td><code>boolean</code></td><td><code>false</code></td><td>Determines whether the user may enter negative values, or decrement the value beyond zero with the button controls. Also, when enabled, the user may paste a numeric text that begins with a dash. Otherwise, the paste is ignored.</td></tr><tr><td>Default value</td><td><code>js</code></td><td><code>''</code></td><td>Initial value of the input on app load. Also, this value is set when the <code>reset()</code> API method of the input, or a surrounding <a href="form">Form</a>, is triggered. This JavaScript expression is supposed to evaluate to a value of type <code>number</code>. Otherwise, it is ignored and the input is kept empty. In case the given value does not comply with the configured rules, e.g. the value is negative but the "Allow negative" property is set to <code>false</code>, the value is anyway used as input value.</td></tr><tr><td>Placeholder</td><td><code>stringWithJs</code></td><td><code>'Enter number'</code></td><td>Text that is displayed in the input when no value has been entered yet.</td></tr><tr><td>Show controls</td><td><code>boolean</code></td><td><code>true</code></td><td>Determines whether the increment and decrement button will be displayed to the right of the input. Those controls allow to increment and decrement the value with mouse click.</td></tr></tbody></table>

#### Custom properties of date/time inputs

This includes the **Date Input**, **Time Input** and the **Date & Time Input**:

<table><thead><tr><th width="158">Property</th><th width="159">Type</th><th width="161">Default value</th><th>Behavior</th></tr></thead><tbody><tr><td>Custom date format</td><td><code>stringWithJs</code></td><td><code>'yyyy-MM-dd'</code></td><td>Custom format to be used instead of the preconfigured options of the "Date format" property. Only available when the "Date format" property is set to "Custom". The format should be written as described for <a href="https://date-fns.org/v2.29.3/docs/format">date-fns.format</a>.</td></tr><tr><td>Custom time format</td><td><code>stringWithJs</code></td><td><code>'HH:mm'</code></td><td>Custom format to be used instead of the preconfigured options of the "Time format" property. Only available when the "Time format" property is set to "Custom". The format should be written as described for <a href="https://date-fns.org/v2.29.3/docs/format">date-fns.format</a>.</td></tr><tr><td>Date format</td><td><code>string</code></td><td><code>'yyyy-MM-dd'</code></td><td>Display format of the date part in the input, and which is used to parse the input value in case of manual input. This setting also influence the format of the   <code>valueFormattedString</code> API property.</td></tr><tr><td>Default value</td><td><code>js</code></td><td><code>null</code></td><td>Initial value of the input on app load. Also, this value is set when the <code>reset()</code> API method of the input, or a surrounding <a href="form">Form</a>, is triggered. The JavaScript expression should either evaluate to a <code>Date</code> object, or an ISO 8601 date string. For a Time Input, a time string in the format of <code>HH:mm</code>, like e.g. <code>'14:30'</code>, is allowed as well.</td></tr><tr><td>First day of week</td><td><code>'Sunday' | 'Monday'</code></td><td><code>'Sunday'</code></td><td>This setting influences the first day of the week in the date picker.</td></tr><tr><td>Show clear icon</td><td><code>boolean</code></td><td><code>false</code></td><td>Determines whether an "x" icon will be shown when a value has been entered. Clicking this icon will clear the input entirely.</td></tr><tr><td>Time format</td><td><code>string</code></td><td><code>'HH:mm'</code></td><td>Display format of the time part of the input value, and format that is used to parse the input value in case of manual input. This setting also influence the format of the   <code>valueFormattedString</code> API property.</td></tr></tbody></table>

**Custom inputs of date range**

<table><thead><tr><th width="157">Property</th><th width="159">Type</th><th width="167">Default value</th><th>Behavior</th></tr></thead><tbody><tr><td>Default start date</td><td><code>js</code></td><td><code>null</code></td><td>Initial value of the input on app load. Also, this value is set when the <code>reset()</code> API method of the input, or a surrounding <a href="form">Form</a>, is triggered. The JavaScript expression should either evaluate to a <code>Date</code> object, or an ISO 8601 date string. </td></tr><tr><td>Default end date</td><td><code>js</code></td><td><code>null</code></td><td>Initial value of the input on app load. Also, this value is set when the <code>reset()</code> API method of the input, or a surrounding <a href="form">Form</a>, is triggered. The JavaScript expression should either evaluate to a <code>Date</code> object, or an ISO 8601 date string. </td></tr><tr><td>Placeholder start date</td><td><code>js</code></td><td><code>null</code></td><td></td></tr><tr><td>Placeholder end date</td><td><code>js</code></td><td><code>null</code></td><td></td></tr><tr><td>Date format</td><td><code>string</code></td><td><code>'yyyy-MM-dd'</code></td><td>Display format of the date part in the input, and which is used to parse the input value in case of manual input. This setting also influence the format of the   <code>valueFormattedString</code> API property.</td></tr><tr><td>First day of week</td><td><code>'Sunday' | 'Monday'</code></td><td><code>'Sunday'</code></td><td>This setting influences the first day of the week in the date picker.</td></tr><tr><td>Show clear icon</td><td><code>boolean</code></td><td><code>false</code></td><td>Determines whether an "x" icon will be shown when a value has been entered. Clicking this icon will clear the input entirely.</td></tr></tbody></table>

**Custom properties of slider inputs**

<table><thead><tr><th width="157">Property</th><th width="159">Type</th><th width="172">Default value</th><th>Behavior</th></tr></thead><tbody><tr><td>Default value</td><td><code>js</code></td><td>1</td><td>Initial value of the input on app load. Also, this value is set when the <code>reset()</code> API method of the input, or a surrounding <a href="form">Form</a>, is triggered. The JavaScript expression should evaluate to a <code>Number</code>.</td></tr><tr><td>Minimum value</td><td><code>js</code></td><td>1</td><td>The JavaScript expression should evaluate to a <code>Number</code>.</td></tr><tr><td>Maximum value</td><td><code>js</code></td><td>5</td><td>The JavaScript expression should evaluate to a <code>Number</code>. Note that the maximum may never be reached if it does not equal the sum of the minimum value and a multiple of the step size.</td></tr><tr><td>Step size</td><td><code>js</code></td><td>1</td><td>The JavaScript expression should evaluate to a <code>Number</code>. The step size describes in which increments the value of the slider increases when the slider is dragged.</td></tr></tbody></table>

#### Custom properties of file input

<table><thead><tr><th width="157">Property</th><th width="159">Type</th><th width="172">Default value</th><th>Behavior</th></tr></thead><tbody><tr><td>Allowed file types</td><td><code>js</code></td><td><code>null</code></td><td>If you want to restrict the types of files that a user can upload, you simply provide an array of file extensions to whitelist them. If it is empty, it allows all file types.</td></tr><tr><td>Allow multiple files</td><td><code>boolean</code></td><td><code>false</code></td><td>Defines if the user can select and upload multiple files.</td></tr></tbody></table>

### Events

All input components offer the same set of UI events:

* **On change**: This event is triggered whenever the input value changes, e.g. because the user is typing, has pasted new content or has cleared the input by clicking on the clear-icon. This event is not triggered when the value changes programmatically via the `setValue`, `clear` or `reset` methods.&#x20;
* **On blur**: This event is triggered when the input loses focus.

### API

All input components share the following properties and methods in their JavaScript API:

<table><thead><tr><th width="271">Property / Function</th><th width="210">Type</th><th>Behavior</th></tr></thead><tbody><tr><td><code>clear()</code></td><td><code>() => void</code></td><td>Clears the input, i.e. sets the input for the empty string for textual input types, and to <code>null</code> for all others.</td></tr><tr><td><code>disabled</code></td><td><code>boolean</code></td><td>Current value of the "Disabled" property.</td></tr><tr><td><code>label</code></td><td><code>string</code></td><td>Current value of the "Label" property.</td></tr><tr><td><code>reset()</code></td><td><code>() => void</code></td><td>Sets the value of the input to the current value of the "Default value" property. This is useful when a form or individual component should not just be emptied, but instead reset to what it was initially on app load.</td></tr><tr><td><code>setDisabled(value)</code></td><td><code>(value: boolean) => void</code></td><td>Sets the "Disabled" property to the provided value.</td></tr><tr><td><code>setLabel(value)</code></td><td><code>(value: string) => void</code></td><td>Sets the "Label" property to the provided value.</td></tr><tr><td><code>validate()</code></td><td><code>() ⇒ Promise</code></td><td>We return a <code>Promise</code> that runs all validation rules for the current value. When the promise resolves, a <code>boolean</code> is returned. If <code>true</code> is returned, the input is valid, otherwise it is invalid. </td></tr></tbody></table>

#### API of textual inputs

This includes the **Text Input**, **Textarea**, **Password Input**, **Email Input** and **URL Input**:

<table><thead><tr><th width="271">Property / Function</th><th width="210">Type</th><th>Behavior</th></tr></thead><tbody><tr><td><code>passwordVisibility</code></td><td><code>boolean</code></td><td><code>true</code> in case the input value is currently visible as clear text, i.e. the user clicked the visibility icon, <code>false</code> otherwise. Only for <strong>Password Input</strong>.</td></tr><tr><td><code>placeholder</code></td><td><code>string</code></td><td>Current value of the "Placeholder" property.</td></tr><tr><td><code>setPasswordVisibility(value)</code></td><td><code>(value: boolean) => void</code></td><td>Sets the password visibility, i.e. the password is displayed as clear text when true is provided as argument, otherwise the password is hidden. Only for <strong>Password Input</strong>.</td></tr><tr><td><code>setPlaceholder(value)</code></td><td><code>(value: string) => void</code></td><td>Sets the "Placeholder" property to the provided value.</td></tr><tr><td><code>setValue(value)</code></td><td><code>(value: string) => void</code></td><td>Sets the input value to the provided value.</td></tr><tr><td><code>value</code></td><td><code>string</code></td><td>Current value of the input.</td></tr></tbody></table>

#### API of numeric inputs

This includes the **Number Input** and the **Percent Input**:

<table><thead><tr><th width="277">Property / Function</th><th width="210">Type</th><th>Behavior</th></tr></thead><tbody><tr><td><code>allowDecimals</code></td><td><code>boolean</code></td><td>Current value of the "Allow decimals" property.</td></tr><tr><td><code>allowNegative</code></td><td><code>boolean</code></td><td>Current value of the "Allow negative" property.</td></tr><tr><td><code>placeholder</code></td><td><code>string</code></td><td>Current value of the "Placeholder" property.</td></tr><tr><td><code>setAllowDecimals(value)</code></td><td><code>(value: boolean) => void</code></td><td>Sets the "Allow decimals" property to the provided value.</td></tr><tr><td><code>setAllowNegative(value)</code></td><td><code>(value: boolean) => void</code></td><td>Sets the "Allow negative" property to the provided value.</td></tr><tr><td><code>setPlaceholder(value)</code></td><td><code>(value: string) => void</code></td><td>Sets the "Placeholder" property to the provided value.</td></tr><tr><td><code>setValue(value)</code></td><td><code>(value: number | null) => void</code></td><td>Sets the input value to the provided value. In case <code>null</code> is provided, the input is cleared.  In case a negative value is provided, but the "Allow negative" property is currently set to <code>false</code>, the input value is set to <code>0</code>. In case a decimal value is provided, but the "Allow decimals" property is set to <code>false</code>, the decimals are cut off.</td></tr><tr><td><code>value</code></td><td><code>number | null</code></td><td>Provides the current value of the input. <code>null</code> in case no value has been entered, otherwise a <code>number</code>.</td></tr></tbody></table>

#### API of date/time inputs

This includes the **Date Input**, **Time Input,** **Date & Time Input** and **Date Range Input**:

<table><thead><tr><th width="271">Property / Function</th><th width="210">Type</th><th>Behavior</th></tr></thead><tbody><tr><td><code>setValue(value)</code></td><td><code>(value: string | Date | null) => void</code> (except date range input: <code>(value: {state: string | Date | null, end: string | Date | null}</code>)</td><td>Sets the input value to the provided value. In case <code>null</code> is provided, the input is cleared.  In case a <code>Date</code> object is provided, the date and time parts are filled according to its values. In case of an argument of type <code>string</code>, the string is expected to either be an ISO 8601 string, or a string that is formatted according to the "Date format" and "Time format" (or, "Custom date format" / "Custom time format") properties. Otherwise, an error is thrown.</td></tr><tr><td><code>value</code></td><td><code>Date | null</code> (excpet date range input: <code>{state: Date | null, end: Date | null}</code>)</td><td>Provides the current value of the input. <code>null</code> in case no value has been entered, otherwise a <code>Date</code> object. In case of a <strong>Date Input</strong>, the time part of the <code>Date</code> will be 00:00:00.</td></tr><tr><td><code>valueFormattedString</code></td><td><code>string | null</code></td><td>Provides the current value of the input as a formatted string, using the formats from the "Date format" / "Custom date format" / "Time format" / "Custom time format" properties. <code>null</code> in case the input currently has no value. Date and time parts are separated by a space (<code>' '</code>).</td></tr><tr><td><code>valueISOString</code></td><td><code>string | null</code></td><td>Provides the current input value as a string in ISO 8601 format. <code>null</code> in case the input currently has no value. For a <strong>Time input</strong>, the value is formatted as <code>HH:mm</code>. The <strong>Date Input</strong> uses <code>yyyy-MM-dd</code>. </td></tr></tbody></table>

**API of the slider**

<table><thead><tr><th width="271.3333333333333">Property / Function</th><th width="215">Type</th><th>Behavior</th></tr></thead><tbody><tr><td><code>maximum</code></td><td><code>number</code></td><td>Current value of "Maximum" property.</td></tr><tr><td><code>setMaximum(value)</code></td><td><code>(value: number) => void</code></td><td>Sets the "Maximum" property to the provided value.</td></tr><tr><td><code>minimum</code></td><td><code>number</code></td><td>Current value of "Minimum" property.</td></tr><tr><td><code>setMinimum(value)</code></td><td><code>(value: number) => void</code></td><td>Sets the "Minimum" property to the provided value.</td></tr><tr><td><code>stepSize</code></td><td><code>number</code></td><td>Current value of "Step Size" property.</td></tr><tr><td><code>setStepSize(value)</code></td><td><code>(value: number) => void</code></td><td>Sets the "Step Size" property to the provided value.</td></tr><tr><td><code>value</code></td><td><code>number</code></td><td>Current value of the input.</td></tr><tr><td><code>setValue(value)</code></td><td><code>(value: number) => void</code></td><td>Sets the value to the provided value.</td></tr></tbody></table>

#### API of the file input

| Property / Function | Type                                           | Behavior                                                  |
| ------------------- | ---------------------------------------------- | --------------------------------------------------------- |
| files               | `{name: string, size: number, type: string}[]` | The file names, their sizes and types that were uploaded. |
| multiple            | `boolean`                                      | Returns if the file input allows multiple files.          |
| setMultiple(value)  | `(value: boolean) => void`                     | Set the "Allow multiple files" property.                  |
| accept              | `string[]`                                     | Returns a list of file extensions that are allowed.       |
| setAccept(value)    | `(value: string[]) => void`                    | Set the file extensions that are allowed to be uploaded.  |
