How to use custom Vue components in Dashboard ui-template

Hi everyone,

I'm working on a project with Node-RED and @flowfuse/node-red-dashboard (Dashboard 2.0) where I rely heavily on custom UI templates.

I'm looking to build a reusable component system by publishing my custom Vue 3 components as a standalone npm package. Ideally, I’d like to import this package into my Node-RED setup so that the components are registered globally and can be used out of the box in any ui-template node (just like Vuetify or component libraries work), e.g., <my-custom-card :data="msg.payload" />.

Is it possible to do something like this? if not, has someone encountered this same problem and how did they fix it?

Thanks in advance!

Your only option at this time is to setup a CDN and import your common code

Of course that CDN could simply be a resource served from an endpoint on your node-red instance (or a common central node-red instance)

See the cookbook http-endpoints for examples

In your case it might be: http-in → template node containing your definitions → http-response or http-in → file-nodes to load your package data → http-response

See the dashboard docs for how to load a CDN (or your endpoint) resource: loading-external-dependencies

Unfortunately, not in the way you're describing.

Each ui-template runs as its own Vue application, so components aren't automatically shared or globally registered across templates like they would be in a standard Vue/Vite application. There isn't currently a supported mechanism to install an npm package into Dashboard 2.0 and have its components globally available in every ui-template.

A few alternatives are:

  • Load your component library via a CDN or bundled UMD/ESM build inside each ui-template, then register the components locally.
  • Create a shared JavaScript file containing your components or composables and include it wherever needed.
  • Build a custom Dashboard 2.0 widget/node if you need reusable components across many flows. This is the recommended approach for reusable UI functionality.
  • If you're already using a build tool (Vite/Rollup/Webpack), you can bundle your component library and import it into each template, but you'll still need to register the components within that template's Vue app.

So, while you can definitely reuse Vue components, Dashboard 2.0 doesn't currently support a plugin system equivalent to app.use(MyLibrary) that registers components globally across all ui-template nodes.

If your goal is to create something that behaves like Vuetify or another Vue component library, a custom Dashboard widget/package is probably the cleanest long-term solution.

Or, if you don't need D2's features, you could switch to UIBUILDER which will let you use all of Vue's features.

I tried a lot db2 templates, but in the end I gave up.

I'm currently building a React+Tailwind component library.

latest build