Schema Explorer
Important note about accessibility: In version 1.3 of the schema we introduced a label property on Inputs to improve accessibility. If the Host app you are targeting supports v1.3 you should use label instead of a TextBlock as seen in some samples below. Once most Host apps have updated to the latest version we will update the samples accordingly.
Input.Toggle
Lets a user choose between two options.
| Property | Type | Required | Description | Version |
|---|---|---|---|---|
| type | "Input.Toggle" |
Yes | Must be "Input.Toggle". |
1.0 |
| title | string |
Yes | Title for the toggle | 1.0 |
| id | string |
Yes | Unique identifier for the value. Used to identify collected input when the Submit action is performed. | 1.0 |
| value | string |
No, default: "false" |
The initial selected value. If you want the toggle to be initially on, set this to the value of valueOnβs value. |
1.0 |
| valueOff | string |
No, default: "false" |
The value when toggle is off | 1.0 |
| valueOn | string |
No, default: "true" |
The value when toggle is on | 1.0 |
| wrap | boolean |
No | If true, allow text to wrap. Otherwise, text is clipped. |
1.2 |
Inherited properties
| Property | Type | Required | Description | Version |
|---|---|---|---|---|
| errorMessage | string |
No | Error message to display when entered input is invalid | 1.3 |
| isRequired | boolean |
No | Whether or not this input is required | 1.3 |
| label | string |
No | Label for this input | 1.3 |
| fallback | Element, FallbackOption |
No | Describes what to do when an unknown element is encountered or the requires of this or any children canβt be met. | 1.2 |
| height | BlockElementHeight |
No | Specifies the height of the element. | 1.1 |
| separator | boolean |
No | When true, draw a separating line at the top of the element. |
1.0 |
| spacing | Spacing |
No | Controls the amount of spacing between this element and the preceding element. | 1.0 |
| isVisible | boolean |
No, default: true |
If false, this item will be removed from the visual tree. |
1.2 |
| requires | Dictionary<string> |
No | A series of key/value pairs indicating features that the item requires with corresponding minimum version. When a feature is missing or of insufficient version, fallback is triggered. | 1.2 |
Example
Properties
title
Title for the toggle
- Type:
string - Required: Yes
value
The initial selected value. If you want the toggle to be initially on, set this to the value of valueOn's value.
- Type:
string - Required: No, default:
"false"
valueOff
The value when toggle is off
- Type:
string - Required: No, default:
"false"
valueOn
The value when toggle is on
- Type:
string - Required: No, default:
"true"
wrap
If true, allow text to wrap. Otherwise, text is clipped.
- Type:
boolean - Version : 1.2
- Required: No
id
Unique identifier for the value. Used to identify collected input when the Submit action is performed.
- Type:
string - Required: Yes
errorMessage
Error message to display when entered input is invalid
- Type:
string - Version : 1.3
- Required: No
isRequired
Whether or not this input is required
- Type:
boolean - Version : 1.3
- Required: No
label
Label for this input
- Type:
string - Version : 1.3
- Required: No
fallback
Describes what to do when an unknown element is encountered or the requires of this or any children can't be met.
- Type:
Element,FallbackOption - Version : 1.2
- Required: No
- Allowed values:
ActionSetColumnSetContainerFactSetImageImageSetInput.ChoiceSetInput.DateInput.NumberInput.TextInput.TimeInput.ToggleMediaRichTextBlockTableTextBlock"drop": Causes this element to be dropped immediately when unknown elements are encountered. The unknown element doesn't bubble up any higher.
height
Specifies the height of the element.
- Type:
BlockElementHeight - Version : 1.1
- Required: No
- Allowed values:
"auto": The height of the container will be determined by the height of its contents."stretch": The container will stretch its height to the available remaining height of the parent container.
separator
When true, draw a separating line at the top of the element.
- Type:
boolean - Required: No
spacing
Controls the amount of spacing between this element and the preceding element.
- Type:
Spacing - Required: No
- Allowed values:
"default""none""small""medium""large""extraLarge""padding"
isVisible
If false, this item will be removed from the visual tree.
- Type:
boolean - Version : 1.2
- Required: No, default:
true
requires
A series of key/value pairs indicating features that the item requires with corresponding minimum version. When a feature is missing or of insufficient version, fallback is triggered.
- Type:
Dictionary<string> - Version : 1.2
- Required: No