Views
Views are app-customised UI surfaces inside Slack — the contents of a modal dialog or the App Home tab.
ModalView— content of a modal opened withviews.open/views.update/views.push.HomeTabView— content of the App Home tab, published withviews.publish.
Pass view.to_dict() as the view argument to the Slack SDK's view methods.
Slack reference: https://api.slack.com/reference/surfaces/views
Views are app-customized visual areas within modals and Home tabs.
See: https://api.slack.com/reference/surfaces/views.
HomeTabView
HomeTabViews are used with the views.publish Web API method.
See: https://api.slack.com/reference/surfaces/views#home.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
blocks
|
Block | list[Block]
|
A list of blocks that defines the content of the view (max 100). |
required |
private_metadata
|
str | None
|
a string (max 3000 chars) that will be sent to your app
in |
None
|
callback_id
|
str | None
|
A string that will identify submissions of this view. |
None
|
external_id
|
str | None
|
A custom identifier that is unique within the views of a given Slack team. |
None
|
Source code in slackblocks/views.py
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 | |
ModalView
Modal views are used with the views.open, views.update and views.push
Slack Web API methods.
See: https://api.slack.com/reference/surfaces/views#modal
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
TextLike
|
heading that appears at the top left of the view. |
required |
blocks
|
Block | list[Block]
|
a list of blocks (max 100) that define the content of the view. |
required |
close
|
TextLike | None
|
the text of the close button (max 24 chars) in the view.
Must be |
None
|
submit
|
TextLike | None
|
the text of the submit button (max 24 chars) in the view.
Must be |
None
|
private_metadata
|
str | None
|
a string (max 3000 chars) that will be sent to your app
in |
None
|
callback_id
|
str | None
|
A string that will identify submissions of this view. |
None
|
clear_on_close
|
bool | None
|
when |
False
|
notify_on_close
|
bool | None
|
when |
False
|
external_id
|
str | None
|
A custom identifier that is unique within the views of a given Slack team. |
None
|
submit_disabled
|
bool | None
|
when |
False
|
Source code in slackblocks/views.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |