Interactive code snippets with Sandpack - a showcase.
Tags: webdev, codesnippets, documentation
Published: 2022-02-07 13:09:51

---
title: Interactive code snippets with Sandpack - a showcase.
published: true
description: Check out some of the amazing ways people have been using Sandpack to improve the experience of code on the web.
tags: webdevelopment, codesnippets, documentation
cover_image: https://codesandbox.io/static/banner-27af9c0a457d58842d9cb2605f3c1646.png
canonical_url: https://codesandbox.io/post/sandpack-showcase
---

Sharing code snippets have always been a huge part of learning on the web. Documentations, blogposts, tutorials and other learning platforms use code snippets regularly to educate their audiences.

These snippets are usually either accompanied with a screenshot to show the reader a preview or they have to copy it over to their machine and run to see the results. With Sandpack however, we get both the editable code and a preview, live in the browser. It’s amazing!

![Sandpack image](https://codesandbox.io/acc7979f18b8dbac2b37fba6fa865722/sandpack.gif)

## What is Sandpack?

Sandpack is a component toolkit that makes it possible to have interactive, live-running code editing experiences in the browser. It is the in-browser bundler that powers CodeSandbox that is now open source. Check out the [announcement article here](https://codesandbox.io/post/sandpack-announcement).

With Sandpack’s live coding environment, you get:

- A full editor experience with syntax highlighting.
- An advanced preview that takes advantage of npm dependency support, hot module reloading etc.
- One click away from opening your code snippets directly in CodeSandbox.

## Sandpack Showcase

The use cases for having this kind of experience is limitless and we are excited to see different applications spring up using Sandpack. Here are a few we’ve found exciting.

### Interactive Coding Tutorials

With Sandpack, you can power up your coding tutorials. [CodeAmigo](https://codeamigo.dev) has lessons that you can practice and follow along. They use Sandpack together with their custom editor for running the code.

![CodeAmigo](https://codesandbox.io/static/8c7ac53f64180a022a3ba4cef83c1955/5cc77/codeamigo.png)

[XState Tutorials](https://xstate-tutorials.vercel.app/) uses Sandpack to teach XState, a library that brings state machines to Javascript and Typescript, through solving puzzles and instant feedback from the interactive UI.

![X-state](https://codesandbox.io/static/e56488a8bfdcea098cc5f9e487f22bb6/5cc77/x-state.png)

### Guided Walkthroughs

Sandpack also comes in handy for walkthroughs - showing progress through a project or step-by step-tutorials. [CodeHike](https://codehike.org/) is a library that allows you to create guided code walkthroughs - they implemented Sandpack using the [sandpack-client](https://sandpack.codesandbox.io/docs/advanced-usage/client) for showing the live running code in a preview.

![CodeHike](https://codesandbox.io/static/02c5b3ba8bc380e6f973e823146b6ca6/5cc77/codehike.png)

### Technical Documentation

The new React Documentation uses Sandpack for its examples and challenges. They were able to fully style and customize Sandpack for their needs including just syntax highlighting in some cases. You can learn to do the same with Sandpack’s [Custom UI options](https://sandpack.codesandbox.io/docs/getting-started/custom-ui#visual-options).

![React docs](https://codesandbox.io/static/419e8d4fbbdf477dbf4c76cbf4f9abf1/5cc77/react-docs.png)


Chris, [@ctnicholasdev](https://twitter.com/ctnicholasdev) has Sandpack implemented on his web technologies blog for interactive tutorials and demos. In this article about using [Sandpack for Code Demos](https://www.ctnicholas.dev/articles/how-to-use-sandpack-for-code-demos), he’s able to show how Sandpack can change how we learn on the web.

![CTNicholas](https://codesandbox.io/static/bf2f5b58568b229ceb2bfab2286a8aef/5cc77/ctnicholas.png)

### Web Editors

GitLab uses Sandpack to execute frontend projects so you can write code, and make commits all while seeing the live results.

![Gitlab live Preview](https://codesandbox.io/static/84407bc8284f139edf6a4c806e9c1a63/5cc77/gitlab-live-preview.png)

If you’re using Sandpack, we’d love to know and also add to our showcase! Go ahead and share it with our [Discord community](https://discord.gg/Pr4ft3gBTx).

If you're new to [Sandpack](https://github.com/codesandbox/sandpack), you can get started with the [documentation](https://sandpack.codesandbox.io/docs) and get support or start a conversation on our [discord community](https://discord.gg/Pr4ft3gBTx).

We are really excited about the possibilities for Sandpack and there's really no limit on what you can use it for.