# Toggle Button

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

## Basic

#### Default Value

Enter the default boolean-string to set the state of the widget 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-85d53355c8031c12fc0b78580920eced535fe3da%2Fimage%20(365).png?alt=media" alt=""><figcaption></figcaption></figure>

## 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> |

#### 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>

## Advanced

#### Show Text

| Property       | Description                                                                                                                                                                                                                                                                                     |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Text for True  | <p>The string to be displayed when the toggle state is ON<br><br><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-f276141e913a819e1140e5643d7a14ebcd0c2537%2Fimage%20(368).png?alt=media" alt=""></p>  |
| Text for False | <p>The string to be displayed when the toggle state is OFF<br><br><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-12f264f6a26e392d1d3dec1b05072d052345b875%2Fimage%20(369).png?alt=media" alt=""></p> |

#### Icon for True

Choose one from the set of icons that will be displayed as a logo, when the toggle state is ON.

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

#### Icon for False

Choose one from the set of icons that will be displayed as a logo, when the toggle state is OFF.

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

#### Icon Position

| Property | Description                                                                                                                                                                                                                                                                                   |
| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Left     | <p>The logo icon is displayed at the left to the widget text<br><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-3c1036d15431ae467a49c72dec6347d91282c0c3%2Fimage%20(372).png?alt=media" alt=""></p> |
| Right    | <p>The logo icon is displayed at the left to the widget text<br><img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-628fa6144e0d651891c4ae5c8d57ca7af2a4d7d9%2Fimage%20(373).png?alt=media" alt=""></p> |

#### Alignment

| Property                                                                                                                                                                                                                                       | Layout                                                                      |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| <img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-47ae7090e2a28f4c89278741bac4685937023d24%2Fimage%20(374).png?alt=media" alt="" data-size="original"> | `Left` - The content is attached to the left side of the screen             |
| <img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-4338718fd822caf83600a0097380e7b70495563a%2Fimage%20(375).png?alt=media" alt="" data-size="original"> | `Center` - The content is placed at the center part of the screen           |
| <img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-8d2b0f1cf1aad51f50e19da853bbbdf494a2e540%2Fimage%20(376).png?alt=media" alt="" data-size="original"> | `Right` - The content is attached to the right side of the screen           |
| <img src="https://125370873-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzdpN2Lz0hzXpnNScDzVt%2Fuploads%2Fgit-blob-57bb1074fa3a1f25d9009b202ee1f4234142c99e%2Fimage%20(377).png?alt=media" alt="" data-size="original"> | Justify - The content is adjusted and justified to the width of the screen. |

## Style

#### Show Border

Makes the border of the widget visible on the screen. The 'Border Color' and 'Border Width' styles are applied to this when enabled.

<table><thead><tr><th width="218" align="center">Property</th><th>Description</th></tr></thead><tbody><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">Hover Color</td><td>Set the background colour for the widget when the user moves the mouse over it.</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><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 Transform</td><td>This property specifies how to capitalize an element's text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized. <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform">MDN web docs</a></td></tr><tr><td align="center">Text Decoration</td><td>This property sets the appearance of decorative lines on text. Types are "underline", "overline", "line-though", "overline-underline".</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></tbody></table>
