Dev.to WebDev 🛠 Dev 👁 1 📖 1 min read

I published my first npm package — stark, a small React component library

I just published stark, a small React + TypeScript component library, as my first npm package. Sharing it here mostly because I learned a ton building and shipping it, and I'm hoping it's useful (or at least interesting)

I published my first npm package — stark, a small React component library

 I just published stark, a small React + TypeScript component library, as my first npm package. Sharing it here mostly because I learned a ton building and shipping it, and I'm hoping it's useful (or at least interesting) to other devs.
What it is
stark is a set of four ready-to-use React components:

DynamicIslandNavbar — an animated, iOS-style dynamic island navbar
FAQAccordion — a clean accordion for FAQ sections
DropdownMenu — a lightweight, customizable dropdown
FileDownloadButton — a button component for triggering file downloads

Install
npm install @omkarwarik1204/stark
Why I built it
I kept rebuilding the same handful of UI patterns across my own projects (portfolio, dashboards, etc.), so I decided to package them properly instead of copy-pasting code every time. It also felt like a good excuse to learn how npm publishing actually works end to end.
What I learned

Building a library with Vite's library mode instead of a regular app build
Generating and fixing TypeScript declaration files (.d.ts) — this tripped me up more than I expected
Structuring components for tree-shaking so consumers only bundle what they use
The actual npm publish workflow — versioning, package.json fields like main/module/types, .npmignore

What's next

Writing proper docs (thinking a small docs site)
Adding more components
Improving TypeScript prop typing / JSDoc comments

Feedback welcome
This is my first published package, so if you try it out — bugs, API suggestions, "why did you do it this way" — I'd genuinely love to hear it.
🔗npm
🔗 Github

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.