Skip to content

Latest commit

 

History

History
58 lines (48 loc) · 1.45 KB

File metadata and controls

58 lines (48 loc) · 1.45 KB

`Option` Blocks

Blocks to generate a single option for a Picker.

Options do not have to be provided explicitly, one can also use Links or Texts as options within a Picker.

Checkout Picker for more information.

Explicit options can have a title, a hint text, even a URL.

Example with explicit Options:

Picker("Importance", selection: $importance,
       placeholder: "Select importance")
{
    Option("High 💎💎✨").tag("high")
    Option("Medium 💎")  .tag("medium")
    Option("Low ⚪️")     .tag("low")
}

Docs: https://api.slack.com/reference/block-kit/block-elements#multi_select

Blocks API Representation

In a static Picker:

{
  "type"        : "static_select",
  "action_id"   : "actionId-3",
  "placeholder" : {
    "type": "plain_text", "text": "Select an item", "emoji": true
  },
  "options"     : [
    { "text": {
        "type": "plain_text", "text": "*this is plain_text text*", "emoji": true
      },
      "value": "value-0"
    },
    { "text": {
        "type": "plain_text", "text": "*this is plain_text text*", "emoji": true
      },
      "value": "value-1"
    },
    { "text": {
        "type": "plain_text", "text": "*this is plain_text text*", "emoji": true
      },
      "value": "value-2"
    }
  ]
}