> For the complete documentation index, see [llms.txt](https://appmaster.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://appmaster.gitbook.io/docs/web-apps/components-list/switch.md).

# Switch

## **Look\&Feel Settings:**

**Label** (not mantory) to be used to show the component's label.

**Name** (mantory) - this name will help you find this component in BP.

**Size** (mantory) - standard switch sizes.

**Default checked** (mantory) - turn on by default.

**Disabled** (mantory) - availability of the switch in the application. Is turned on by default.

**Visible** (mandatory) - makes the component visible if turned on. Enabled by default.

![](https://3563768697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MapxHzVskQ_27pNUTT4-1972196547%2Fuploads%2FgMuTComEb5RDEK2Bwgdx%2Fimage.png?alt=media\&token=48d81684-95a7-4df7-a5a9-e70503b6809d)

## **Workflow triggers:**

* **onChange** – fires when a change occurs in the field;
* **onBlur** – fires when the field is deselected;
* **onFocus** – fires when a field is selected (clicked on);
* **onCreate** – fires when the element is created on the page;&#x20;
* **onShow** – fires when the component changes its state to visible (displayed on the page);&#x20;
* **onHide** – fires when the component changes its state to hidden (stops being displayed);&#x20;
* **onDestroy** – fires when the component is destroyed;
* **onClick** - fires when the component is clicked.

## **Component Actions:**

### **Switch Get Properties**

Gets switch properties

**Input** parameters:

* **Component Id** \[*string*] *-* switch component's identifier.

**Output** parameters:

* **Label** \[*string*] - component's label;
* **Placeholder** \[*string*] - component's placeholder;
* **Disable** \[*boolean*] - disables component if *true*;
* **Visible** \[*boolean*] - component visibility stat&#x65;**.**
* **Tooltip** \[*string*] - tooltip string;
* **Required Mark** \[*boolean*] - shows required mark if *true*;
* **Debounce** (ms) \[*integer*] - delay to validate the value;
* **Validate Icon** \[*boolean*] - icon to be showed on validate the value;
* **Validate Status** \[*Status type*] - status to be showed on validate the value;&#x20;
* **Validate Message** \[*string*] - message to be showed on validate the value.

![](https://3563768697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MapxHzVskQ_27pNUTT4-1972196547%2Fuploads%2FB0ga69tT420VA5VO2mWF%2Fimage.png?alt=media\&token=cf9cee4b-fa69-4f81-a20a-4174ce7b7965)

### Switch Set Properties

Sets all switch properties

**Input** parameters:

* **Component Id** \[*string*] *-* switch component's identifier;
* **Label** \[*string*] - component's label;
* **Placeholder** \[*string*] - component's placeholder;
* **Disable** \[*boolean*] - disables component if *true*;
* **Visible** \[*boolean*] - component visibility stat&#x65;**.**
* **Tooltip** \[*string*] - tooltip string;
* **Required Mark** \[*boolean*] - shows required mark if *true*;
* **Debounce** (ms) \[*integer*] - delay to validate the value;
* **Validate Icon** \[*boolean*] - icon to be showed on validate the value;
* **Validate Status** \[*Status type*] - status to be showed on validate the value;&#x20;
* **Validate Message** \[*string*] - message to be showed on validate the value.

![](https://3563768697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MapxHzVskQ_27pNUTT4-1972196547%2Fuploads%2F0AQflQ8cTCARxET7We6C%2Fimage.png?alt=media\&token=efb6a150-527b-4d8d-b916-be07efeefb34)

### Switch Update Properties

Update switch properties

**Input** parameters:

* **Component Id** \[*string*] *-* switch component's identifier;
* **Label** \[*string*] - component's label;
* **Placeholder** \[*string*] - component's placeholder;
* **Disable** \[*boolean*] - disables component if *true*;
* **Visible** \[*boolean*] - component visibility stat&#x65;**.**
* **Tooltip** \[*string*] - tooltip string;
* **Required Mark** \[*boolean*] - shows required mark if *true*;
* **Debounce** (ms) \[*integer*] - delay to validate the value;
* **Validate Icon** \[*boolean*] - icon to be showed on validate the value;
* **Validate Status** \[*Status type*] - status to be showed on validate the value;&#x20;
* **Validate Message** \[*string*] - message to be showed on validate the value.

![](https://3563768697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MapxHzVskQ_27pNUTT4-1972196547%2Fuploads%2F66x7fLAl3Wme8TMEAT5P%2Fimage.png?alt=media\&token=71c4637f-5d7b-4284-9f46-cf7c9b197c8a)

## Usage example:

Switch can be used to publish existing posts

![](https://3563768697-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MapxHzVskQ_27pNUTT4-1972196547%2Fuploads%2FkSE9ATFpMPghrxbezNlV%2F1233.gif?alt=media\&token=96edb764-ff9d-4812-aa94-d2710255b37e)
