Free Open Source Tailwind CSS Components
hyperui.dev
hyperui.dev
Has anyone used something like Tailwind-Styled-Component [1] and found it worthwhile?
``` <Question> {...} <Footer> < button> { ... } </button> <QuestionBadge> </QuestionBadge> </Footer> </Question> ```
That's easier than
``` <div className = " ... "> { ...} <div> <div> </div> ```
<Question
mt0
textCenter
p8={extraPadding}
p2={!extraPadding}
/>
Or you could have another variation, but optimization is more difficult: <Question
mt={0}
text="center"
p={extraPadding ? 8 : 2}
/> <button
bg="blue-400 hover:blue-500 dark:blue-500 dark:hover:blue-600"
text="sm white"
font="mono light"
p="y-2 x-4"
border="2 rounded blue-200"
>I especially like how easy it is to fall back onto ordinary Styled Components if I'm trying to implement things more specific than what tailwind can handle.
Here's a sample of what I've implemented with twin.macro: https://grueplan.com
For example, in CSS you could create a class for a card called “.card”, but this by itself does not create a card component as you may need card-title within it and card-wrapper on the outside, and various other styles that may seem like they are reusable subcomponents but are not. And it’s a misnomer because it may require a more complicated HTML structure and you cannot just create a div and apply a class “card” and get back the component.
Instead in a real app your component has an HTML structure, a css structure, and the reusable package you put it in may be the react component, and not style called “card” that you can use.
Tailwind advocates for making your components reusable on this framework level (whether vue or react), rather than at the CSS level. Because even if your make your CSS reusable you still have to recreate the HTML structure. And if you put your HTML in a reusable component and also have a set of reusable styles then you have a Card component concept and a Card style concept that becomes redundant.
To address your specific problem, if your code is unreadable due to inline tailwind styles then it’s a sign you should be breaking the HTML into reusable sub components instead.
I have my Tailwind css in a global.css file. That's my solution for making it readable.
Something like a throttle or disabling js redirects if it's breaking the history buttons.
I just read this somewhere else (probably on HN) take my comment with salt, sinnce I have no clue of this is real or not.
Of the SPAs, companies want React and people to “hit the ground running”
They dont recognize Vue as that
I don't often collide with company cultures that require specific language/tool experience in my network these days, though I realize they exist out there. I haven't ever hit an issue launching into a job in unfamiliar languages, and I've made that leap with all of Ruby/Java/Golang/PHP/Python – minimal pre-exposure in every case (school was C++).
Lots of recruiters and hiring managers dont see it that way
I guess the only missing piece there is a backend API.
I bought Chakra and now kind of regretting, seeing all the free stuff, Daisy for instance is something that I never heard of until I saw the comments here.
Tailwind let me quickly create any UI I want, and Daisy helps me reduce the amount of time needed to style basic elements like inputs and all.
Firebase lets me get a low latency real time data source for my application, that can scale infinitely. It also handles some other parts of building an application that normally take a lot of time: authentication, storage management etc. And the pricing is really really cheap once you consider how much it costs to create an infrastructure that scales as well as firebase does, unless you model your data wrong and end up using a lot of db read/write cycles unnecessarily.
The backend API piece is not missing, you can use either Next.js API or firebase functions for backend piece, I use those for things like stripe billing backend etc.
This stack is enough for most projects out there, and when its not enough its flexible enough that you can integrate it with other things. And that timeline I mentioned was for a production ready MVP.
The documentation on https://nextjs.org/learn/basics/api-routes/api-routes-detail... seems quite sparse. I see basic routing and middleware but seems nowhere near as many features as other frameworks.
I see it's great for building an MVP but may not be a good fit outside of startups. Nevertheless, its the front-end and server side rendering is quite interesting to me.
What are some problems with this setup? Might have a go just for the frontend portion but seems to good to be true in some aspects.
EDIT: It is funny because I've been looking for something opinionated like Bootstrap, but that can be tree-shaken to a smaller package, like Tailwind, but I don't want have to redesign every dang component.
I know some have pointed out in other threads they wish tailwind ui components were more of a complete working example with Alpine examples included, it's a fair complaint and area of improvement. But overall I don't have any issue with the model for tailwind ui.
i keep a list of these libraries here https://github.com/sw-yx/spark-joy/blob/master/README.md#tai... and just gave it a little star to demonstrate quality
Except 5.1 that broke my homemade dark theme implementation with their use of css variables ;)
Tailwind is in every way superior when you are implementing a bespoke design, you develop faster, your CSS is small and less complex, the output is performant, you have a uniform mini-language, if you apply some up front analysis of a design/-system you can generate 90% of your CSS from a normalized configuration.
Now compare that to fighting default styles and complected component styles, applying overrides, extending via SCSS variables and generating your own CSS utilities with SCSS. It's pretty night and day for this use-case.
Component libs for tailwind that compress the classes are a bit funny and IMO you don't get much benefit from them other than playing nice with tailwind. You might have a reason to use tailwind but want predefined component classes? But then you get the same disadvantage that component based libraries like bootstrap have, so the choice is arbitrary here.
What makes _much_ more sense is what tailwindui does, they give you the raw source, so you get to write out of the box components quickly but can pull them apart without friction.
> Now compare that to fighting default styles and complected component styles
As I said, I am NOT fighting default styles. I want them.
I don't WANT to write my own components, just change colors with Sass (and maybe some affordances).
I'm an engineer, not a UX designer, and I don't have budget to hire a UX designer (nor do I pretend to be good at UX like most programmers). Bootstrap is ideal for my situation, and many others in my position.
Also, what are you talking about? Tailwind absolutely does NOT give you out of the box components. Only third-parties, like DaisyUI and OP's link are fully formed components (or the links off of the tailwind page), which are at best like bootstrap and at worse an inconsistent mess.
Well, no. And that's by design. Should you want components, there's an official Tailwind UI[0] that the dgb23 also mentioned. Not to mention the uncountable amount of open-source component libraries.
Like Bootstrap way, you can still define that with Tailwind classes either in input.css with @apply directive (abstract out utility classes from HTML) or Tailwind configuration. It’s a way to speed up our development.
When Bootstrap debuted, its big strength was that it gave you a decent UI for little effort, at a time when the popular alternative was `vim styles.css`.
Needs and tools have shifted. Fewer projects get their UI from a programmer with no design sense. More projects need more widgets that aren't available off-the-shelf. Component-based web frameworks make it easier to build reusable widgets in-house.
(I think in didn't help that it took Bootstrap forever to stop depending on jQuery, and SPAs got popular and didn't need jQuery but did need to reduce page weight)
Quick feedback on the website: The left side of the components preview pages falls off the left side of my screen (Chrome, 13'' Mac).
How does it compare to TailwindUI?
So I can't use Tailwind UI, I can use this.
(If one of my Tailwind-using side projects gets popular enough and starts making me money, I will probably buy a Tailwind UI license just to support Tailwind, though! Even though I won't use it. Or maybe I'll find another way to support them.)
- There are more components.
- One thing I love are the fully styled landing pages. They are made up of components as well, but I like seeing them put together in a coherent fashion.
- You get not only pure HTML code, but also Vue and React code to copy/paste.
- IMHO it's nicer looking and feels more polished.
However, all of this comes at a price, I think I paid $250 for it. I also find the designs to be nicer, but sometimes they are a pain to change because somewhere in the nested `div`'s there's some magic happening that I'm not dealing with properly.
I do think there is a place for such free, simpler and clean component libraries and I appreciate their creator for making it available.
They cover different needs - Tailwind is a low-level CSS library that provides a different (and some claim better) way of styling HTML. It doesn't provide markup, interactivity, etc.
AntD is a high-level component library that provides components with pre-built markup, JS interactivity, accessibility, etc. Any of the component libraries in this thread are a good point of comparison.
You might use Tailwind if you're building out your own components, or styling a page that doesn't need much interactivity. It is fast, lightweight, and easy to integrate. You can compare it to any CSS-in-JS tool, SASS, and other styling solutions.
You'd typically turn towards a component library (like MaterialUI, Ant Design, or Tailwind UI) if you're looking to quickly build a webapp that needs a lot of interactivity out of the gate. These solutions are larger and heavier, but provide a lot more functionality (interactivity, accessibility).
Edit: nvm there is a plug-in.
Love this so much - good job