Building more contextual search command results with Block Kit
Take advantage of the new Block Kit elements to send a more contextual message
We’ve just released Block Kit, a UI framework that enables you to build rich and interactive experiences in Slack. Block Kit consists of stackable blocks that you can mix and match to build a message, giving your apps more options to display information in each message. You can prototype with the Block Kit Builder, a visual tool, as well as actually build messages sent by your app using the JSON string generated by the tool.
In this tutorial, we’ll take advantage of the new Block Kit elements to send a more contextual message and improve the user experience of search results in your app. We’ll use a restaurant app as our sample, and we’ll create a slash command where a user can send the
/find-food command to get a list of a few restaurants as the result.
Once you’ve mastered the creation of rich messages in response to slash commands, you’ll learn how to send messages to a channel using incoming webhooks, via the Web API using
chat.postEphemeral, and post in response to message actions and rich interactions.
To build your own app using Block Kit, read the entire tutorial and follow the step-by-step tutorial!
Feedback? Questions? Drop us a note at firstname.lastname@example.org or tweet us @SlackAPI.