KBAISE/ for lovable
Library
Docs

Using npm packages

about 3 minBuildingchecked 5d agoOfficial page
The short version

You can add complex tools like charts and drag-and-drop into your app without writing them from scratch. Just tell Lovable what feature or ready-made package you want in chat, and it handles the installation.

Anyone who needs advanced features like charts, animations, or drag-and-drop without building them from scratch.

Do this, in order

  1. 1

    Find a package on npmjs.com that matches your needs, or just decide on the feature you want to add.

    Using existing, tested libraries saves building time and gives you more reliable features.

  2. 2

    Type a message in the Lovable project chat naming the package or describing the desired functionality.

    Lovable automatically adds the code to your project files without requiring any terminal commands.

  3. 3

    Test the new feature thoroughly in your app preview to ensure it works smoothly in a web browser.

    Lovable does not guarantee third-party code quality, and some packages designed for desktop or mobile will not run in a web browser.

Paste this into your project

Use the @hello-pangea/dnd npm package to add drag-and-drop functionality to my Kanban board app. Ensure users can add new cards, move them within columns, and reorder them.

Words decoded

npm package
A pre-written bundle of code shared publicly so other creators can reuse it instead of coding common features from scratch.
bun.lock / bun.lockb
A background file that saves the exact versions of the pre-built code used in your project so nothing breaks unexpectedly.

Where people get stuck

  • Do not request packages meant exclusively for desktop (like Electron) or mobile device hardware (like Capacitor plugins); they install fine but fail to run in the browser.
  • Do not choose outdated or abandoned packages; look for libraries that have high download counts and recent updates.
  • Do not edit package configuration files or delete the bun.lock file manually; ask Lovable in chat whenever you want to update or remove a package.

The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.