Schema Explorer

Choose element:

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.Text

Lets a user enter text.

Property Type Required Description Version
type "Input.Text" Yes Must be "Input.Text". 1.0
id string Yes Unique identifier for the value. Used to identify collected input when the Submit action is performed. 1.0
isMultiline boolean No If true, allow multiple lines of input. 1.0
maxLength number No Hint of maximum length characters to collect (may be ignored by some clients). 1.0
placeholder string No Description of the input desired. Displayed when no text has been input. 1.0
regex string No Regular expression indicating the required format of this text input. 1.3
style TextInputStyle No Style hint for text input. 1.0
inlineAction ISelectAction No The inline action for the input. Typically displayed to the right of the input. It is strongly recommended to provide an icon on the action (which will be displayed instead of the title of the action). 1.2
value string No The initial value for this field. 1.0

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
labelPosition InputLabelPosition No [SUPPORTED ONLY IN JAVASCRIPT SDK] Determines the position of the label. It can take ‘inline’ and ‘above’ values. By default, the label is placed ‘above’ when label position is not specified. 1.6
labelWidth string, number No [SUPPORTED ONLY IN JAVASCRIPT SDK] Determines the width of the label in percent like 40 or a specific pixel width like ‘40px’ when label is placed inline with the input. labelWidth would be ignored when the label is displayed above the input. 1.6
inputStyle InputStyle No [SUPPORTED ONLY IN JAVASCRIPT SDK] Style hint for input fields. Allows input fields to appear as read-only but when user clicks/focuses on the field, it allows them to update those fields. 1.6
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

JSON
{
	"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
	"type": "AdaptiveCard",
	"version": "1.0",
	"body": [
		{
			"type": "TextBlock",
			"text": "Default text input"
		},
		{
			"type": "Input.Text",
			"id": "defaultInputId",
			"placeholder": "enter comment",
			"maxLength": 500
		},
		{
			"type": "TextBlock",
			"text": "Multiline text input"
		},
		{
			"type": "Input.Text",
			"id": "multilineInputId",
			"placeholder": "enter comment",
			"maxLength": 500,
			"isMultiline": true
		},
		{
			"type": "TextBlock",
			"text": "Pre-filled value"
		},
		{
			"type": "Input.Text",
			"id": "prefilledInputId",
			"placeholder": "enter comment",
			"maxLength": 500,
			"isMultiline": true,
			"value": "This value was pre-filled"
		}
	],
	"actions": [
		{
			"type": "Action.Submit",
			"title": "OK"
		}
	]
}
Adaptive Card

Properties

isMultiline

If true, allow multiple lines of input.

  • Type: boolean
  • Required: No

maxLength

Hint of maximum length characters to collect (may be ignored by some clients).

  • Type: number
  • Required: No

placeholder

Description of the input desired. Displayed when no text has been input.

  • Type: string
  • Required: No

regex

Regular expression indicating the required format of this text input.

  • Type: string
  • Version : 1.3
  • Required: No

style

Style hint for text input.

  • Type: TextInputStyle
  • Required: No
  • Allowed values:
    • "text"
    • "tel"
    • "url"
    • "email"
    • "password": Added in version 1.5. Display input text with password masking.
JSON
{
	"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
	"type": "AdaptiveCard",
	"version": "1.3",
	"body": [
		{
			"type": "TextBlock",
			"text": "Specify the type of text being requested:",
			"style": "heading"
		},
		{
			"type": "Input.Text",
			"id": "myComment",
			"label": "style: text",
			"style": "text"
		},
		{
			"type": "Input.Text",
			"id": "myEmail",
			"label": "style: email",
			"style": "email"
		},
		{
			"type": "Input.Text",
			"id": "myTel",
			"label": "style: tel",
			"style": "tel"
		},
		{
			"type": "Input.Text",
			"id": "myUrl",
			"label": "style: url",
			"style": "url"
		},
		{
			"type": "Input.Text",
			"id": "myPassword",
			"label": "style: password",
			"style": "password"
		}
	],
	"actions": [
		{
			"type": "Action.Submit",
			"title": "OK"
		}
	]
}
Adaptive Card

inlineAction

The inline action for the input. Typically displayed to the right of the input. It is strongly recommended to provide an icon on the action (which will be displayed instead of the title of the action).

  • Type: ISelectAction
  • Version : 1.2
  • Required: No
  • Allowed values:
    • Action.Execute
    • Action.OpenUrl
    • Action.Submit
    • Action.ToggleVisibility
JSON
{
	"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
	"type": "AdaptiveCard",
	"version": "1.5",
	"body": [
		{
			"type": "Input.Text",
			"id": "iconInlineActionId",
			"label": "Text input with an inline action",
			"inlineAction": {
				"type": "Action.Submit",
				"iconUrl": "https://adaptivecards.io/content/send.png",
				"tooltip": "Send"
			}
		},
		{
			"type": "Input.Text",
			"label": "Text input with an inline action with no icon",
			"id": "textInlineActionId",
			"inlineAction": {
				"type": "Action.OpenUrl",
				"title": "Reply",
				"tooltip": "Reply to this message",
				"url": "https://adaptivecards.io"
			}
		}
	]
}
Adaptive Card

value

The initial value for this field.

  • Type: string
  • 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
JSON
{
	"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
	"type": "AdaptiveCard",
	"version": "1.3",
	"body": [
		{
			"type": "Input.ChoiceSet",
			"id": "requiredCompactId",
			"style": "compact",
			"isMultiSelect": false,
			"label": "Required Input.ChoiceSet label (compact)",
			"isRequired": true,
			"errorMessage": "This is a required input",
			"placeholder" : "Please make selection",
			"choices": [
				{
					"title": "Option 1",
					"value": "1"
				},
				{
					"title": "Option 2",
					"value": "2"
				}
			]
		},
		{
			"type": "Input.ChoiceSet",
			"id": "requiredExpandedId",
			"style": "expanded",
			"isMultiSelect": false,
			"label": "Required Input.ChoiceSet label (expanded)",
			"isRequired": true,
			"errorMessage": "This is a required input",
			"choices": [
				{
					"title": "Option 1",
					"value": "1"
				},
				{
					"title": "Option 2",
					"value": "2"
				}
			]
		},
		{
			"type": "Input.ChoiceSet",
			"id": "requiredMultiselectId",
			"style": "expanded",
			"isMultiSelect": true,
			"label": "Required Input.ChoiceSet label (expanded, multiselect)",
			"isRequired": true,
			"errorMessage": "This is a required input",
			"choices": [
				{
					"title": "Option 1",
					"value": "1"
				},
				{
					"title": "Option 2",
					"value": "2"
				}
			]
		}
	],
	"actions": [
		{
			"type": "Action.Submit",
			"title": "OK"
		}
	]
}
Adaptive Card

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
JSON
{
	"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
	"type": "AdaptiveCard",
	"version": "1.3",
	"body": [
		{
			"type": "Input.ChoiceSet",
			"id": "input1",
			"style": "compact",
			"isMultiSelect": false,
			"label": "Default Input.ChoiceSet label (compact)",
			"choices": [
				{
					"title": "Option 1",
					"value": "1"
				},
				{
					"title": "Option 2",
					"value": "2"
				}
			]
		},
		{
			"type": "Input.ChoiceSet",
			"id": "input2",
			"style": "compact",
			"isMultiSelect": false,
			"label": "Required Input.ChoiceSet label (compact)",
			"isRequired": true,
			"errorMessage": "Required input",
			"choices": [
				{
					"title": "Option 1",
					"value": "1"
				},
				{
					"title": "Option 2",
					"value": "2"
				}
			]
		},
		{
			"type": "Input.ChoiceSet",
			"id": "input3",
			"style": "expanded",
			"isMultiSelect": false,
			"label": "Default Input.ChoiceSet label (expanded)",
			"choices": [
				{
					"title": "Option 1",
					"value": "1"
				},
				{
					"title": "Option 2",
					"value": "2"
				}
			]
		},
		{
			"type": "Input.ChoiceSet",
			"id": "input4",
			"style": "expanded",
			"isMultiSelect": false,
			"label": "Required Input.ChoiceSet label (expanded)",
			"isRequired": true,
			"errorMessage": "Required input",
			"choices": [
				{
					"title": "Option 1",
					"value": "1"
				},
				{
					"title": "Option 2",
					"value": "2"
				}
			]
		},
		{
			"type": "Input.ChoiceSet",
			"id": "input5",
			"style": "expanded",
			"isMultiSelect": true,
			"label": "Default Input.ChoiceSet label (expanded, multiselect)",
			"choices": [
				{
					"title": "Option 1",
					"value": "1"
				},
				{
					"title": "Option 2",
					"value": "2"
				}
			]
		},
		{
			"type": "Input.ChoiceSet",
			"id": "input6",
			"style": "expanded",
			"isMultiSelect": true,
			"isRequired": true,
			"label": "Required Input.ChoiceSet label (expanded, multiselect)",
			"errorMessage": "Required input",
			"choices": [
				{
					"title": "Option 1",
					"value": "1"
				},
				{
					"title": "Option 2",
					"value": "2"
				}
			]
		}
	],
	"actions": [
		{
			"type": "Action.Submit",
			"title": "OK"
		}
	]
}
Adaptive Card

labelPosition

[SUPPORTED ONLY IN JAVASCRIPT SDK] Determines the position of the label. It can take 'inline' and 'above' values. By default, the label is placed 'above' when label position is not specified.

  • Type: InputLabelPosition
  • Version : 1.6
  • Required: No
  • Allowed values:
    • "inline"
    • "above"

labelWidth

[SUPPORTED ONLY IN JAVASCRIPT SDK] Determines the width of the label in percent like 40 or a specific pixel width like '40px' when label is placed inline with the input. labelWidth would be ignored when the label is displayed above the input.

  • Type: string, number
  • Version : 1.6
  • Required: No

inputStyle

[SUPPORTED ONLY IN JAVASCRIPT SDK] Style hint for input fields. Allows input fields to appear as read-only but when user clicks/focuses on the field, it allows them to update those fields.

  • Type: InputStyle
  • Version : 1.6
  • Required: No
  • Allowed values:
    • "revealOnHover"
    • "default"

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:
    • ActionSet
    • ColumnSet
    • Container
    • FactSet
    • Image
    • ImageSet
    • Input.ChoiceSet
    • Input.Date
    • Input.Number
    • Input.Text
    • Input.Time
    • Input.Toggle
    • Media
    • RichTextBlock
    • Table
    • TextBlock
    • "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