Now, we’re going to cover Code blocks and Embeds. These are two block types that might occasionally come useful in your daily Notion usage, especially if you work with code or external tools a lot.
Copy link to headingCode Blocks
This block is meant for correctly storing code snippets; preserving their original formatting and adding highlighting. While Notion is not a dedicated Code editor or IDE, it is often used for documentation in development teams, or just for casual coding projects. That’s where Code Blocks come useful.
To add a Code Block, just use the /code command. This will spawn a new block with a border – this is a fully self-contained text field where you can copy in your code.
[Code block creation GIF]
As you start typing in a Code Block, you’ll notice that t
If you hover over the block, you’ll see some options at the top. In the top left, you’ll be able to choose your programming language — this will help with code highlighting and formatting. On the right, you’ll see a Copy button, which lets you copy the entire content of the block at once, and a Caption button, which lets you add a brief caption underneath the block, similar to image blocks.
[GIF showing code block language settings]
Pro tip: Code blocks are also great for storing plain text that needs to be easily copied all at once — just set Plain Text as the language, and make copying much easier, with just a single button, instead of highlighting and copying text as you’d need to do without a code block.
If you click on the three-dot menu in the top right of a Code Block, you’ll see two additional options: Wrap Code, which lets you wrap the code thus making it all readable without scrolling horizontally, and Format Code, which will format all your code based on the language you have selected.
[GIF code wrapping]
Copy link to headingEmbeds
While there are more advanced ways to “integrate” Notion with other apps now (primarily, the API, which we will cover in a later module), Embeds are still a popular way of quickly previewing other apps, documents, or files directly in Notion.
We briefly mentioned embeds in our previous lesson on images. While embedding publicly available files such as images or videos is one way to use embeds, we can also use this same block to display a bunch of other stuff, including publicly available PDFs, Google Docs or Spotify playlists. Embedding lets you preview publicly available content from supported websites right inside your Notion doc. You can also embed a lot of websites as well, but not all — support for specific websites depends on whether the owner of the website allows such embedding, but there’s a good chance that your favorite websites are supported.
If you try typing /embed you’ll see a bunch of options show up in the slash menu. The first will be a regular “Embed” block, and below you’ll see a bunch of suggested websites and apps you can embed as well. If you use the “generic” embed block, you’ll be able to paste any link from a supported app and a little “preview” (embed) of said link will show up.
[GIF embed block spawn]
Here are a few popular apps that can be embedded (keep in mind there are many more and this list is definitely not exhaustive):
| Abstract | Canva | CodePen | Excalidraw | Flocus | |
|---|---|---|---|---|---|
| Framer | Indify | Invision | GitHub Gist | GIPHY | |
| Google Maps | Loom | Miro | Mixpanel | ||
| Replit | Sketch | Streamlit | Slideshare | Spotify | |
| Tableau | Tally | TikTok | Typeform | Vimeo | |
| Widgetbox | YouTube |
Although I don’t use embeds very often, they’re definitely a nice option when needed. I can definitely seem them used heavily in specific contexts – for example, a design team might often want to embed files from Canva or Figma directly in a Notion doc for easy access. My team and I use the Loom video embed most often – since we record a lot of video tutorials for both internal and external use.
