r/webdev • u/vinishkapoor • 1d ago
Showoff Saturday [Showoff Saturday] VinUI: an open-source component library where 8 visual styles share the same markup
I've been working on VinUI, an MIT-licensed component library for plain HTML, React, Vue and Svelte.
The main idea is that each of the eight styles (Precision, Tactile, Clay, Tonal, Editorial, Terminal, Paper, Bento) is only a set of CSS variables, so markup and props never change between looks. Instead of a runtime package, a CLI copies plain source files into your project:
npx /ui init
npx /ui add <component>
npx u/vinish/ui diff # see upstream changes since you copied- 63 components, 13 page blocks and 16 plain-SVG charts
- WCAG 2.2 AA checked in every style, light and dark
- Works next to Tailwind or your own CSS
Repo: https://github.com/devvinish/vin-ui
Docs and live style switcher: https://vinish.dev/ui
Feedback welcome, especially on the theming approach and the copy-in model.
3
u/leticia304 1d ago
The copy-in model gives teams ownership, but updates get tricky once a component is customized. Does `ui diff` show upstream changes alongside local divergence, or just compare with the copied baseline?
2
u/poojadeliverwebsite 1d ago
Styles as nothing but CSS variables, with the markup never changing, is a really nice constraint. Curious how far it holds for the looks that differ most, like Clay or Paper where the shadow and border recipe is very different. Is that still all variables, or do some components read a style attribute? Also glad to see the diff command, that's the part most copy-into-your-repo libraries skip.
2
u/Snowkate8 23h ago
The live style switcher makes the idea much easier to judge than screenshots. I'd be curious to see focus and disabled states in each style too, since that's where the shared visual system has to hold up beyond the happy path.