Create a snippet

Snippets are a quick, easy way to share bits of code, configuration files, or log files with your Slack team.   

Add a new snippet

  1. Next to the Slack message box, click the  plus sign button.
  2. Select Code or text snippet.
  3. Enter a title (optional) and select a file type from the menu. This can be plain text or a computer language such as HTML or Javascript.
  4. When you’re finished, click Create Snippet.

Keyboard shortcut: Enter (Mac) or Ctrl Shift Enter (PC) will open a pop-up window for creating a new snippet in Slack.

Tip: Upload a plain text file in Slack and it will automatically convert to a snippet. Your teammates will be able to read it easily without opening a separate application. 👍🏽

 

Share a snippet

Sharing a snippet in Slack lets your team members download it, view a raw version, or leave comments.

For sharing options, just mouse over the snippet and click the More actions menu.

To share the snippet in a channel or direct message, select Share and choose where to post your snippet.


Create a public link

Snippets can also be made public for easy sharing outside of Slack. In the More actions menu (as shown above), select Create public link. Your public link will appear at the top of the snippets page — just copy the link to share it!

In the future, if you need to make the snippet private again, just follow the same steps and select Revoke public link.

Related Articles

Recently Viewed Articles