How to add NPM packages
Install NPM packages like React, Vue, or any library from the NPM registry directly in PlayCode.
Method 1: Using the NPM Packages panel
- Look for the NPM PACKAGES section in the left sidebar.
- Click the plus (+) icon next to "NPM PACKAGES".
- Type the package name (for example,
canvas-confettiorreact). - Choose the version you want to install.
- The package will be installed automatically.
- You can now import and use it in your code.
Method 2: Auto-install on import
You don't need to manually install packages before using them. Just start writing your code and import the package you need:
import confetti from 'canvas-confetti'PlayCode will automatically detect the missing package and suggest installing it.
Managing packages
To view or remove installed packages:
- Open the NPM PACKAGES section in the sidebar.
- You'll see all installed packages with their versions.
- To remove a package, click the three dots (...) next to it and select Delete.
Important notes
- PlayCode uses a UI-based package manager instead of a terminal with
npm install - Dependencies from
package.jsonare not automatically installed - You need to manually install each package using the NPM PACKAGES panel
- Most NPM packages are supported and work out of the box
Common packages
Popular packages that work well in PlayCode:
react- React libraryvue- Vue.js frameworkthree- Three.js 3D librarycanvas-confetti- Confetti animationsaxios- HTTP clientlodash- Utility functions
Related Articles
Need more help?
Can't find what you're looking for? Chat with us or send us an email.