Using npm packages
You can add advanced features like drag-and-drop or charts to your Lovable project by asking for specific JavaScript libraries called npm packages. Lovable will automatically add and integrate these packages into your app without you needing to install anything yourself.
Anyone building an app with Lovable who wants to add pre-built functionalities to their project.
Do this, in order
- 1
Think about a feature you want to add to your app, like drag-and-drop or charts.
This page helps you add complex features quickly without building them from scratch.
- 2
In your Lovable project chat, describe the feature you want, or name a specific npm package if you know one.
Lovable will find, install, and integrate the right package into your project based on your request.
- 3
Before relying on a package, check its download count, how often it's updated, and what other users say about it.
This helps ensure the package is reliable, secure, and well-maintained, preventing future problems in your app.
Paste this into your project
Add drag-and-drop functionality to my Kanban board app using an npm package. Ensure users can add new cards, move them within columns, and reorder them.
Words decoded
- npm packages
- These are ready-made pieces of JavaScript code that other developers have created and shared. They're like pre-built LEGO blocks you can add to your project to quickly get new features without writing all the code yourself.
- Kanban board
- A visual tool, often used in project management, that helps organize tasks into columns (like 'To Do', 'In Progress', 'Done') and allows you to move them around, often with drag-and-drop.
- serverless backend
- This means your app's behind-the-scenes operations (like storing data or running calculations) are handled by a cloud provider without you needing to manage a dedicated server. It scales automatically as your app's usage changes.
- dependencies
- These are other pieces of code or packages that your project relies on to work correctly. When Lovable adds an npm package, it becomes one of your project's dependencies.
- managed registry
- A private storage area for your company's own npm packages. This allows you to share internal code securely within your team or organization, rather than using publicly available packages.
- bun.lock
- A file that records the exact versions of all the npm packages used in your project. This ensures that your app always builds and runs consistently, no matter where or when it's built.
Where people get stuck
- Do not try to install npm packages yourself; Lovable handles it automatically.
- Do not assume all npm packages are high quality, secure, or reliable; always check their reputation and maintenance status.
- Do not use packages designed for desktop (Electron) or mobile (Capacitor) apps, as they will not work in your Lovable web app even if they install.
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.