StackBlitz - Online Code Editor For Angular and React

Written by Sebastian on August 6, 2017 · 4 min read

tutorial

StackBlitz is an online IDE which supports Angular and React development projects out-of-the box. The guys from thinkster.io have created that great project to make it as easy as possible to get started with your Angular or React project without the need to deal with installation of dependencies or create a build configuration.

StackBlitz has many great and outstanding features which no other online code editor has to offer at the moment. So it’s worth taking a deeper look at StackBlitz and see what this online IDE has to offer.

Setting Up A Project

Setting up a new project is as easy as opening up the project’s website at https://stackblitz.com and clicking on one of the following options:

to start a new project:

Image

The online code editor view is opened immediately and the project is pre-configured. The following screenshot shows the editor view after having started a new Angular project:

The view is split up into three sections.

Smart Completions Of Code

The code editor supports smart code completions as you type, as you can see in the following screenshot:

Image

This feature is similar to IntelliSense which is known from Visual Studio Code. Starting typing in keywords or expressions brings up a list with all suggestions. You can select one entry from the list and hit return to complete the code.

Installing Dependencies

Installing libraries with StackBlitz is easy by using the in-browser NPM client. The client is available by extending the DEPENDENCIES entry from the tree structure which is displayed in the left view:

Image

You’ll get a list of already installed NPM packages. An input field is available which can be used to typing in a NPM package name (e.g. @angular/material). Hitting return will automatically install that dependency.

If there are any unmet peer dependencies you’ll be informed in the following way:

Image

Clicking on button INSTALL MISSING DEPENDENCIES will add those libraries as well.

Another very cool feature is: If you paste in existing code into the StackBiz editor, it will automatically detect missing packages. You will be able to install those missing packages by simply clicking on one button.

Offline Support

StackBlitz is a Progressive Web App (PWA) which let’s you continue your work even when your network connection is lost. You can still make changes to the project and even the development web server and the live preview will still be available.

Once the network connection is back again, everything is synced to the server again without the need to do anything manually.

StackBlitz allows to share your project very easily by providing just an URL to your audience. You simply need to click on button SHARE from the top menu and you’ll see the following dialog:

Image

This dialog offers three URLs you can use to share your project:

What’s Next

StackBlitz has just been release for the first time and already looks very promising. It has lots of cool features which makes developing in the browser a breeze. Beside the support of Angular and React the project team has already promised to extend StackBlitz to support Vue.js in the near future.