HTML-first, framework-agnostic implementation of shadcn/UI – franken/UI
franken-ui.dev
franken-ui.dev
> Who is Franken UI for?
> Franken UI is tailored for small teams and solo developers seeking a beautiful, reliable CSS framework without the complexity of React, Vue, or Svelte. It's designed with an "HTML-first" approach, making it accessible to developers at any skill level.
https://www.franken-ui.dev/docs/introduction
As opposed to the shadcn ui
> Which frameworks are supported?
> You can use any framework that supports React.
> Next.js, Astro, Remix, Gatsby etc.
it's not about not-being-something, more like the component created by UI kit will function regardless of any framework you use, or the lack of one.
But this franken <form> element requires JavaScript to even render. Same for the tooltip, leader, cover, totop, ++ components; all of which can be done with HTML and CSS.
Fine, write your HTML is JS, but that isn't "HTML first".
edit: I stand corrected. the form will render without JS. The tab element in the docs wrapping the form doesn't render.
Cover, leader, dropdowns and even modals, you can always use the CSS class instead of UIkit custom attributes and toggle it manually via server.
I used it for a small form + search result list recently and it works well enough for simple / static stuff.
But I think I'll still be reaching for a JS lib first since I'd miss things like inputs-with-autocomplete too much.
It would seem that all other libraries want js for something as simple as a drop-down.
The TypeScript and Tailwind insanities are just there for easier development and my convenience. ;)
Maybe soon, someone will publish the compiled CSS. IDK
But this is true for almost every web thing, and every web framework - you can just grab the final outputs and stick it into your web page.
So either your thing is "HTML-first", but so is everything else, or your thing is not "HTML-first", and some other things are.
> Maybe soon, someone will publish the compiled CSS.
So, until then, not only is this not HTML-first, it's not HTML at all.
To me (and maybe others), there's a difference between web development and Node/npm.
They are not one and the same.
I'm also glad I'm not the only one.
I may, however, be the only one to be annoyed at what looks like a rug-pull:
"Here, come see this thing I made that doesn't require $FOO!"
> Requirements: $FOO
> Franken UI is a Tailwind CSS plugin
:|
But yeah, I'm kinda over Tailwind. You whipper-snappers think CSS sucks so much; back in my day* we had font tags and tables!
*high school
Plain CSS and containerisation provided by Svelte (or the forthcoming scope stuff) is more than enough for me.
But learning it is 100% worth it.
Tailwind is like an ORM. I get the appeal but if you know SQL /CSS it’s just going to get in the way.
SQL - Backend - Frontend - CSS
Most people just want to stay in the middle doing backend/frontend ("full-stack") work because it's just writing functions. Or because it's building the core of a feature, where things like database work and styling is pushed off or abstracted in libraries.But on each end is where all the interesting stuff is really happening, and a full-stack dev who embraces both SQL and CSS is a lot more useful than a full-stack dev who stays in the middle.
Sometimes I just wanna work on my app and not write css.
Even the documentation makes it extremely clear which properties are set by which class (the default ones anyway).
As an actual example: how completely braindead do you have to be to not know which properties are set from looking at the official documentation? https://tailwindcss.com/docs/overscroll-behavior
Your comparison to an ORM would work for things like Bulma, bootstrap and pretty much all component libraries, including TailwindUI. It's completely nonsensical for tailwindcss
You've either never actually looked into tailwind css and are purely talking out of your ass or are just repeating this opinion from someone that did such.
Disliking tailwind css is fine, and there are perfectly fine reasons to not use it. But your argument is just plain dumb.
It's very odd to see HN, supposedly a "self-thinker" crowd, continuously spout incorrect things because they heard someone else say it on here. Here are other things I've heard on HN repeatedly that aren't true (often in very upvoted comments).
- You can't make a static site with React
- React is only for SPAs.
- You can't use React without NextJS anymore.
- PHP is too slow for web development (maybe it is for your use case, but people seem to think it's bad for all use cases).
- PHP doesn't have strict type checking.
- NPM is somehow worse than every other packaging system (ignoring PIP, Maven, etc. NPM is surprisingly good at things that the rest of packaging systems don't get right).
Tailwind:
<div className="shadow-lg" />
CSS: div {
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}
Not to mention the Tailwind classNames are compiled to CSS in a build step, where CSS is not compiled, it's written in its native form. They're clearly very different syntaxes and approaches, even though one compiles to the other.The above example shows how convenient Tailwind can be... well if you happen to want that 10px 15px -3px, 4px 6px -4px shadow, but the moment you break out of their palette or default style setup you end up doing stuff like this:
<div className="bg-[#243c5a]" />
Either storing that color value in JavaScript, or creating a Tailwind theme for it in tailwind.config.js: module.exports = {
theme: {
extend: {
colors: {
'regal-blue': '#243c5a'
}
}
}
}
Something that could have been easily accomplished in native CSS: :root {
--regal-blue: #243c5a;
}
div {
background-color: var(--regal-blue);
}
For most React websites, I use Tailwind by default almost always, and Tailwind UI is a great starting point for building a component library. But it still helps to support CSS for more advance styling use cases - even within Tailwind. Knowing CSS very well will make you better at Tailwind too even for common things like <div className="w-[calc(100% - 1rem)]" />
It's kinda important to know both as separate technologies.If I didn't know how box shadow worked, Tailwind made it easier for me to decide by having defaults in the docs that map to the actual CSS.
It's not very extreme, it's literally any time you deviate from their prefab - so any truly custom UI. The size of shadow (corner radius, font-size, etc.) at different steps are hard-coded in Tailwind, if you want something else that's up to you. In terms of colors (text, background, etc.) they have a default palette, colors like "slate", etc. but anything else is up to you. So - most brands.
> Tailwind makes box shadow easier
Easier sure: What it does is give you the abstractions "shadow-sm", "shadow-lg", "shadow-none", etc. in fact a total of SEVEN options for shadows.
That teaches you something - how to apply up to seven types of shadows! But you would be a lot more powerful of a developer if you knew how to do more than that. This doesn't teach you a foundation for understanding box-shadow or learning anything more - I think your point about learning is not valid.
I learned CSS in 2003 from Myspace profiles and Dreamweaver - visual IDEs are great for education, so don't get me wrong here, I'm a believer in what I think you're getting at, but Tailwind aint it (for that).
Did you ever actually write them fully by hand?
I for one got better with css after using tailwindcss for a while. So Capricorn2481's statement is true at least for me.
Before I used it for a while I've always gone with component libraries, after that I very rarely did... Aside from work projects that mandate specific libraries, anyway
Back in my day we used Bootstrap classes but those guys put -15px margins everywhere so nobody uses their library anymore LOL
If I get a visual spec from a designer, I'm not going to try out various numbers until it fits the image. I'll either ask them for the specific attribute if their tool allows for that or replicate it with a generator.
And if I'm fully in control myself, I'm going to use a generator too as I'll want it to look a specific way, which is easier to achieve with instantaneous feedback as you get it from a generator such as https://www.cssmatic.com/box-shadow
CSS shorthand meaning:
margin: 0 0 1rem;
which is the same as: margin-top: 0;
margin-right: 0;
margin-bottom: 1rem;
margin-left: 0;
etc.I can't imagine how you would know the shorthand without first knowing the longer form. CSS shorthand requires that you know the original form + the order of values in shorthand, and when values can be omitted along with special formatting as in:
font: normal normal 1em/1.6em sans-serif;
CSS shorthand is - I would say - more advanced than long form.> I'm going to ask the designer what units to use
I would never get in the habit of letting a designer tell the front-end developers how to write CSS, mainly because they work in pixels, when the developer is often using viewport units, rem for sizing, em for fonts and icons relative to an initial size and current user zoom factor, and flex gaps and alignment for spacing. That level of collaboration and specification on spacing, sizes, etc. between the developer and designer (redlining) might be part of an initial design system discussion, but the resulting component library is probably translated into a style system that works well for the engineering team.
I think it's good you're using CSS generators, I learned most of CSS that way via Dreamweaver, and have copy/pasted from CSS Tricks countless times for edge case stuff - it's a great way to learn.
Absolutely. Have for decades. Still do.
This is why I said Tailwind reminds me of an ORM. If you properly know the underlying technology, it just gets in the way.
And CSS is not just about properties. It's also about inheritance and DOM independence, something tailwind doesn't address.
> if you want something else that's up to you
Right, just like CSS. It's a very light helper library that isn't dissimilar from CSS. That's my point.
I'm mostly a backend developer and TailwindCSS really enabled me to be bold with working with frontend CSS. So far I've been copy pasting examples from Tailwind or Flowbite. But "franken" really looks much closer to what I was looking for, a cleaner opinionated unified interfaces that I can put together, works with Tailwind and can be used with Rails.
Thanks for the work on this.
https://pasteboard.co/6Z1nLEWhPHRg.png
However I do like the dark theme. It manages to separate different areas without too much noise which can be hard to do without shadows.
Right now, I'm cheating a little and it only supports tablet (landscape) and up. Below that will just hide everything and show a static PNG.
The way you actually use the ui components is by including html snippets in your page
The navigation between the different exmaples on https://www.franken-ui.dev/examples/mail refreshed the website and did not restore the scroll position.
While on https://ui.shadcn.com/examples/mail, switching between the different examples keeps the scroll position and does not refresh the page.
We’ve since switched to React-based and found that, because support for React is so high, they can be incorporated elsewhere more seamlessly than “agnostic” components.
> You can use the diff command to check for updates against the registry.
Isn't that a contradiction? So they do offer automatic importing & updating but refuse to use the infrastructure everyone else is using and instead copy/paste their files directly into your project with their cli?
But it's always good to have other options like this one.
https://github.com/sveltecult/franken-ui/tree/master/src/lib...
I am using golang and htmx and am looking around for a simple html based system .
Daisyui or something might work