Publishing a Vue component kit to npm
@vezironi/veyra-ui: a scoped name, Vue as a peer dependency, themes and licensing.
I didn't want Veyra UI to stay a demo site, so I published it to npm as a package I can reuse elsewhere: @vezironi/veyra-ui. Here are the points I paid attention to when packaging a Vue component kit.
A scoped name
The package lives under my own @vezironi/ scope, so there are no name clashes and it's obvious at a glance which packages are mine. Scoped packages are private by default, so the first publish has to say it's public:
npm publish --access public
Don't bundle Vue
Vue is a peer dependency, not a regular one. The project installing the kit uses its own Vue version and you never end up with two copies of Vue on the page:
{
"peerDependencies": {
"vue": "^3.5.0"
}
}
Themes
The kit is built with Tailwind CSS v4 and ships dark and light themes. Exposing colours as CSS variables instead of fixed values means anyone can apply their own theme in a few lines.
License
It's published under the MIT license: anyone can use it, change it and include it in their own projects.
Install
npm i @vezironi/veyra-ui
Live examples and docs are at veyra.vezironi.com, and the source is on GitHub.