Create a snippet

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

Note: You can't currently create or share snippets in our mobile apps.


Add a new snippet

You can create a new snippet from desktop. Here's how: 

  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: Shift 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 members download it, view a raw version, or leave comments.

For sharing options, just mouse over the snippet on your desktop and click the   More actions icon. 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. Click the  More actions icon and 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