sheet Action

An action to show a modal sheet overlay on your UI.

{
  "sheet": {
    "root": {
      "type": "view",
      "layout": "stack",
      "padding": 16,
      "components": [
        {
          "type": "label",
          "text": "Text on a label inside a sheet"
        }
      ]
    }
  }
}

Properties

id
STRING

An optional identifier for the new sheet. This can be used by an event action to close it.

close
STRING

Use this property to close an existing sheet by id.

{
  "sheet": {
    "close": "configsheetid"
  }
}
closeonescape
BOOL
Default: true

Automatically close this sheet when pressing the Escape key. You may want to disable this if providing a custom shortcut for Escape.

root
OBJECT

The root Alfred UI View to populate and show the sheet.

Note

If closeonescape is set to false, you must specify a id so that you can close this sheet using the close property.

Examples

Show a sheet with a label

{
  "type": "button",
  "text": "Open a sheet",
  "events": [
    {
      "triggers": "actioned",
      "action": {
        "type": "json",
        "src": {
          "sheet": {
            "root": {
              "type": "view",
              "layout": "stack",
              "padding": 16,
              "components": [
                {
                  "type": "label",
                  "text": "I am a label inside a sheet.\nPress ⎋ (esc) to dismiss."
                }
              ]
            }
          }
        }
      }
    }
  ]
}