# Relevant Cardscript iconInput.Toggle

Cardscript

Lets a user choose between two options.

# Example

{
  "type": "AdaptiveCard",
  "body": [
    {
      "id": "toggle",
      "type": "Input.Toggle",
      "spacing": "medium",
      "title": "Input.Toggle"
    }
  ],
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "version": "1.0"
}

# Required properties

# id

Unique identifier for the value. Used to identify collected input when the Submit action is performed.

  • Type: string

# title

Title for the toggle.

  • Type: string

# type

Input.Toggle.

  • Type: string
  • Values:
    • Input.Toggle

# Optional properties

# value

The current selected value. If the item is selected that "valueOn" will be used, otherwise "valueOff".

  • Type: string
  • Default: "false"

# valueOff

The value when toggle is off.

  • Type: string
  • Default: "false"

# valueOn

The value when toggle is on.

  • Type: string
  • Default: "true"

# spacing

Controls the amount of spacing between this element and the preceding element.

  • Type: string
  • Values:
    • none
    • small
    • default
    • medium
    • large
    • extraLarge
    • padding

# separator

When true, draw a separating line at the top of the element.

  • Type: boolean

# JSON Schema

{
  "additionalProperties": true,
  "type": "Input.Toggle",
  "description": "Lets a user choose between two options.",
  "allOf": [
    {
      "$ref": "#/definitions/CardElement"
    }
  ],
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the value. Used to identify collected input when the Submit action is performed."
    },
    "title": {
      "type": "string",
      "description": "Title for the toggle"
    },
    "type": {
      "type": "string",
      "description": "Input.Toggle",
      "enum": [
        "Input.Toggle"
      ]
    },
    "value": {
      "type": "string",
      "description": "The current selected value. If the item is selected that \"valueOn\" will be used, otherwise \"valueOff\"",
      "default": "false"
    },
    "valueOff": {
      "type": "string",
      "description": "The value when toggle is off",
      "default": "false"
    },
    "valueOn": {
      "type": "string",
      "description": "The value when toggle is on",
      "default": "true"
    }
  },
  "required": [
    "type",
    "id",
    "title"
  ],
  "typeSafe": "input-toggle",
  "example": "FIXME!",
  "propertySummary": [
    {
      "name": "id",
      "type": "string",
      "required": "Required",
      "text": "Unique identifier for the value. Used to identify collected input when the Submit action is performed."
    },
    {
      "name": "title",
      "type": "string",
      "required": "Required",
      "text": "Title for the toggle"
    },
    {
      "name": "type",
      "type": "string",
      "required": "Required",
      "text": "Input.Toggle"
    },
    {
      "name": "value",
      "type": "string",
      "required": "Optional",
      "text": "The current selected value. If the item is selected that \"valueOn\" will be used, otherwise \"valueOff\""
    },
    {
      "name": "valueOff",
      "type": "string",
      "required": "Optional",
      "text": "The value when toggle is off"
    },
    {
      "name": "valueOn",
      "type": "string",
      "required": "Optional",
      "text": "The value when toggle is on"
    }
  ]
}
Last Updated: 9/10/2023, 11:30:14 AM