# Number Input

<figure><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-30d78ec0601099115c18b411e6c58cae11d2ef20%2Fimage%20(233).png?alt=media" alt=""><figcaption></figcaption></figure>

## Basic

#### Default Value

Enter the default string to be displayed when the widget is loaded. This can also be retrieved from the backend using query or loaded using low-code.

<figure><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-f5c4f423b7116942d156c3a455f2d0da7f803edf%2Fimage%20(76).png?alt=media" alt=""><figcaption></figcaption></figure>

#### Placeholder

Specifies a hint that describes the expected value. The placeholder shows the hint text in the widget when nothing is selected or entered. This text disappears as soon as a value is entered in the control.

<figure><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-6ce53d9ddf9ebc5777d10b45c73e4cdcc00908ff%2Fimage%20(234).png?alt=media" alt=""><figcaption></figcaption></figure>

#### Format

| Property | Description                                                                                                                                                                                                                                                                        |
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Standard | <p>The widget captures the value as a number.<br><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-72c9842cd457cfa2a8475f131bf1f7ec593a7511%2Fimage%20(118).png?alt=media" alt=""></p>     |
| Percent  | <p>The widget captures the value as a percentage.<br><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-28eb95b09e12c4e8ca8b1ddd4541089c0d8fed03%2Fimage%20(117).png?alt=media" alt=""></p> |

## Validation

#### Required Field

Refers to the field that must be completed by the user, which means the field must be entered with a valid value before submitting the information.

<figure><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-60ab18836ad0e6905f89be0f7889e43bb77b7cb6%2Fimage%20(20)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

#### Minimum

The number value entered here acts as the validation for the minimum number for the field. Users cannot enter any value below this.

#### Maximum

The number value entered here acts as the validation for the maximum number for the field. Users cannot enter any value higher.

#### Custom Rule

Apart from validating the entry using the regex rule, users can also use this property to write low-code and check other aspects. For example - check if the city selected in the previous field matches the desired value, throw a custom message to the user even before capturing the entry on this field.

## Interaction

#### Event Handlers

| Event                                         | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <mark style="color:blue;">**`Change`**</mark> | <p>The "Change" event is activated when the value of the widget is changed. When this event triggers, the associated action gets executed.<br><br><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-672dfcc7057f6d8ef62e8b3d953d6023b9a31a4c%2Fimage%20(315).png?alt=media" alt=""></p>                                                                                |
| <mark style="color:blue;">**`Focus`**</mark>  | <p>This event is triggered when the widget receives focus, meaning it becomes the active element that can accept user input.<br><br><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-3aec9c0873fdc0c399aae9ebffa29a05ecd8db27%2Fimage%20(313).png?alt=media" alt=""></p>                                                                                              |
| <mark style="color:blue;">**`Blur`**</mark>   | <p>This event occurs when the user shifts the focus out of the widget. This can happen in different scenarios, such as when a user clicks outside an input widget they were typing in or when the user tabs to another field.<br><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-24927cfad5e62fe4a99996f099833454cba63d05%2Fimage%20(314).png?alt=media" alt=""></p> |
| <mark style="color:blue;">**`Submit`**</mark> | <p>This event will be triggered when the user finishes entering the input and shifts focus away.<br><br><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-2870ab067617e4fea300b5ec6f435e2e08bcabaa%2Fimage%20(81).png?alt=media" alt=""></p>                                                                                                                           |

#### Disabled

Disables the user interaction with the element on the page. It visually indicates that the element is inactive and prevents users from interacting with it when applied. Shows a red-crossed warning symbol and can be customized to disable the widget according to certain conditions using low-code.

<figure><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-695f356d5e8bc58072102f50922157508eb6122b%2Fimage%20(224).png?alt=media" alt=""><figcaption><p>Read-only</p></figcaption></figure>

#### Hide

This sets whether the widget has to be displayed on the screen when the program is loaded. This shows/hides the widget both on desktop and mobile devices.

<figure><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-4aaa812d0b623487c085a616219a4515138079fb%2Fimage%20(211).png?alt=media" alt="" width="338"><figcaption><p>Set the visibility</p></figcaption></figure>

#### Loading

It will be useful when there is a process to be carried out, like running a query to fetch data, before the widget is loaded. The `loading` boolean value can be utilized to show the spinner till the process is complete.

<figure><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-c67f2b672db6a42ef8815bae1bc6c9fb4d5bea53%2Fimage%20(223).png?alt=media" alt=""><figcaption><p>Loading state</p></figcaption></figure>

## Label

Represents the caption for the widget in the user interface. It is recommended to keep the label string short and convey the usage of the widget in the UI

#### Position

| Property | Description                                                                                                                                                                                                                                                                               |
| :------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|  `Left`  | <p>Shows the label on the left side of the tree view<br><br><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-b21d09c73acbd5b1a7b2e73aa18b935f024db6dd%2Fimage%20(235).png?alt=media" alt=""></p> |
|   `Top`  | <p>Shows the label on top of the tree view<br><br><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-e188d63b1578323aea00e7d89d0ca57931a46714%2Fimage%20(238).png?alt=media" alt=""><br></p>       |

#### Alignment

| Property | Description                                                                                                                                                                                                                                                                                                     |
| :------: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|  `Left`  | <p>Align the text on the left corner of the label area<br><br><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-b21d09c73acbd5b1a7b2e73aa18b935f024db6dd%2Fimage%20(237).png?alt=media" alt=""></p>                     |
|  `Right` | <p>Align the text on the right corner of the label area near the tree view<br><br><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-555219bddc71fe7c68af0617fc0d904d7075641b%2Fimage%20(242).png?alt=media" alt=""></p> |

#### Width

Enter a number value to set the width of the widget. It can be set in terms of pixels and percentage.

<figure><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-d9be94a993ae1150c38142b56dedb303a7b487eb%2Fimage%20(94).png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-9c4ec770d5e987d374a18dc814e06c349e3f7749%2Fimage%20(95).png?alt=media" alt=""><figcaption></figcaption></figure>

## Layout

#### Widget Tooltip

This tooltip pops up when the user moves the mouse over the input area of the widget. It is commonly used to hint at the type of input the user needs to provide.

The tooltip will be immediately shown when the user's mouse hovers over the widget, and immediately hides when the user's mouse leaves. This information will be contextual, useful, and informative.

<figure><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-31aac1c7325222b48610a70ff68b580fec30f59d%2Fimage%20(21)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

#### Height

|       |                                             |
| ----- | ------------------------------------------- |
| Auto  | The height is auto-adjusted for the content |
| Fixed | The height of the widget is fixed           |

## Advanced

#### Step

The value must be greater than 0. When the user clicks the up/down buttons at the end of the widget, this number will be increased/decreased to the current number.

<figure><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-d074e90906ddba1dc8e62e4cc0b6f1bcac6e3cd8%2Fimage%20(119).png?alt=media" alt=""><figcaption></figcaption></figure>

#### Precision

This decides the floating-point precision for the number entered on the widget. If the user enters '2' in the property, then the decimal precision is set to 2 digits.

<figure><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-40e48d5a47718b2343ff4f4b8b77070b1e272940%2Fimage%20(122).png?alt=media" alt=""><figcaption></figcaption></figure>

#### Prefix Icon

Choose one from the set of icons that will be displayed as a prefix logo, just before the content.

<figure><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2FHRFvIwFNqCXx6CXblc0d%2Fimage.png?alt=media&#x26;token=a171389d-ca3a-462d-bbc0-2c7ddd4edd27" alt=""><figcaption></figcaption></figure>

#### Suffix Icon

Choose one from the set of icons that will be displayed as a suffix logo, just after the content.

<figure><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2FZABjzvvwDoottXHDDjsk%2Fimage.png?alt=media&#x26;token=0a83e90c-1485-4251-a3a4-d2409874cc55" alt=""><figcaption></figcaption></figure>

#### Allow Null Value

This allows the NULL value to be accepted as a value. This is usually related to development requirements and not necessarily enabled for common use cases.

#### Show Thousands Separator

Enables the comma character separator to split and group the number for easy understanding.

#### Show Increment/Decrement Buttons

Displays the UP and Down arrow buttons on the right end of the widget, for users to click the button to increase and decrease the current input respectively.

#### Read Only

Disables the user entry on the widget, it will be set as read only component. Commonly used to show numbers fetched from backend but to deny user keyboard interaction.

## Style

<table><thead><tr><th width="218" align="center">Property</th><th>Description</th></tr></thead><tbody><tr><td align="center">Label</td><td>Set the colour for the label text. Recommended to set in contrast with the background.</td></tr><tr><td align="center">Background</td><td>Users can change the colour of the text background using this property. It has all the RGB colour ranges to pick from. It is recommended to use a corresponding background colour that shows the font clearly.</td></tr><tr><td align="center">Text</td><td>Set the colour of the text. Recommended to set in contrast with the background.</td></tr><tr><td align="center">Loader Color</td><td>Pick the colour to the loading spinner when the component shows the loader before getting displayed.</td></tr><tr><td align="center">Text Size</td><td>Set the size of the text in px value - 12px</td></tr><tr><td align="center">Text Weight</td><td>Increase or decrease the thickness of the font using the list of numbers from 100-800.</td></tr><tr><td align="center">Font Family</td><td>Type the name of the font family. The reference to the list of font families can be found here: <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/font-family">MDN web docs</a></td></tr><tr><td align="center">Font Style</td><td>There are 3 types of styles that can be applied:<br>"normal" - The text is shown normally, no style applied.<br>"italic" - The text is cursive.<br>"oblique" - A sloped version of the normal text.</td></tr><tr><td align="center">Border Color</td><td>Set the colour to the border lines. The border lines will be shown only if that is enabled.</td></tr><tr><td align="center">Margin</td><td>This value is set in terms of "px" number which creates the space between the border and the content of the widget.</td></tr><tr><td align="center">Padding</td><td>This value is set in terms of "px" number which creates the space between the border and outer elements.</td></tr><tr><td align="center">Border Radius</td><td>This sets the radius of the widget's corners, enabling rounded corners on the widget. This value is defined in "px" terms.</td></tr><tr><td align="center">Border Width</td><td>Set the thickness of the border of the widget using this value. It is defined using "px" terms.</td></tr><tr><td align="center">Prefix Icon Color</td><td>Choose a specific color for the icon that appears before the actual widget content.</td></tr><tr><td align="center">Suffix Icon Color</td><td>Choose a specific color for the icon that appears after the actual widget content.</td></tr><tr><td align="center">Prefix Icon Size</td><td>Set the size of the prefix icon in px value - 12px</td></tr><tr><td align="center">Suffix Icon Size</td><td>Set the size of the suffix icon in px value - 12px</td></tr><tr><td align="center">Accent</td><td><p>An <strong>accent</strong> is a typically bright colour that contrasts with the more utilitarian background and foreground colours within a colour scheme. These are present in the visual style of many platforms (though not all).</p><p>On the web, an accent is sometimes used in input elements for the active portion of the control, for instance, the background of a checked checkbox. <a href="https://developer.mozilla.org/en-US/docs/Glossary/Accent">MSDN web docs</a></p></td></tr><tr><td align="center">Validation Message</td><td>Set the colour of the validation text message. Recommended to set in contrast with the background, usually Red.</td></tr><tr><td align="center">Box Shadow</td><td>The is the colour of the shadow that is generated behind the widget box. The X and Y axis values can be altered such that the shadow can be set to fall anywhere behind the widget area.<br>"x-offset" - a positive number specifies the shadow will be on the right of the box, and a negative number will put the shadow on the left of the box.<br>"y-offset" - a negative one means the shadow will be above the box, and a positive number means the shadow will be below the box.<br>"Blur" - if the number is set to 0 then the shadow will be sharp. It will more blurred as the number goes higher, and the shadow will extend further away.<br>"Color" - sets the colour of the shadow. If the colour is not set, the box shadows are drawn in the foreground colour.</td></tr></tbody></table>

#### Custom CSS

Users can write a specific style using CSS syntax here and the style text will be applied to the widget when the program is loaded.

<figure><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-fa9e1a594d90201b6a93731c5462360bf0264480%2Fimage%20(243).png?alt=media" alt=""><figcaption></figcaption></figure>
