Adding npm packages
Install third-party JavaScript packages into your Loom UI app.
Install a package
From your UI directory:
cd UI
npm install <package-name>
Import the package in the component that uses it. For example, Solid exports createMemo:
import { createMemo } from 'solid-js';
Common examples
# Icons
npm install lucide-solid
# Animation
npm install motion
# Charts
npm install lightweight-charts
Loom packages
Do not manually upgrade @loomgui/bridge or @loomgui/vite-plugin from npm.
They are bundled with the Unity package. Use:
Tools > Loom > Sync UI Dependencies
after installing or upgrading the Unity package.
After installing dependencies
Restart the dev server if the package affects Vite config, PostCSS config, or environment variables:
Tools > Loom > Restart Dev Server
A component-library import usually works without a restart.