Guides Adding npm packages
Guides

Adding npm packages

Install third-party JavaScript packages into your Loom UI app.

Install a package

From your UI directory:

Shell
cd UI
npm install <package-name>

Import the package in the component that uses it. For example, Solid exports createMemo:

TSX
import { createMemo } from 'solid-js';

Common examples

Shell
# 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.

Loom documentation

Search docs

Esc

Type a word or phrase to search the documentation.

Type a word or phrase to search the documentation.