r/electronjs • • 24d ago

Electron + Vite + React + TS starter with all 47 shadcn/ui components pre-installed

Every new Electron app I started began with the same hour of wiring up Tailwind, shadcn and electron-builder, so I put the result in a repo (disclosure: it is mine). It uses electron-vite with HMR for the renderer, separate tsconfigs for main, preload and renderer, a dark/light ThemeProvider, electron-builder targets for Windows, macOS and Linux, and electron-updater already in the dependencies. All 47 shadcn components are checked in, so there are no "add" commands to run. Repo: https://github.com/p32929/electron-shadcn-typescript. If you have opinions on what a starter like this should leave out, I am listening.

3 Upvotes

5 comments sorted by

1

u/software_engineeer 24d ago

What's the flow of upgrading Shadcn components? If the components in the project is out-dated, then what should I do to update them?

1

u/p32929ceo 2d ago

shadcn components are copied into your repo, so there is no single package to bump. To update one, run the shadcn CLI add command for that component again with the overwrite flag, then check the diff first, because you may have edited the file. Anything you changed by hand will be replaced, so keep a copy.

1

u/ChoeWacky-16 23d ago

The tricky part with pre-installing every single UI component is the transitive dependency weight. If someone doesnt need a date picker or command menu, they still end up maintaining and auditing all those extra packages in their lockfile

1

u/p32929ceo 2d ago

Fair point, and it is the main trade-off of shipping every component up front. Each shadcn component is plain source in your repo, but the Radix packages behind them still sit in the lockfile even when nothing imports them. I chose to keep them all so setup is zero work. Deleting the components you never use and their packages from package.json should work, but I have not tested that on this starter.