best way to create reusable components with tailwind and react
i am exploring different ways to create reusable components using tailwind and react and found this https://github.com/enochndika/kimia-UI/blob/main/src/packages/button/button.tsx. is this the best way to do this?
17 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
does it provide intellisense?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
nice
interesting
i always thought i hate cva but it seems nice
thanks i'll try this
i am loving it
thanks!
Adding Custom Styles - Tailwind CSS
Best practices for adding your own custom styles to Tailwind.
you can add component classes
it's kinda like the cva lib mentioned above
so u can use
.select2-search
instead of border border-gray-300 rounded
aaa i don't wanna use @apply tbh
and this is like class based components
i prefer the way cva does it where its prop based
but thanks for the suggestion!
cva is good, also twind has it's own standalone version which is typesafe (idk if cva is or not)
Although I've been thinking about this model and wondering if there isn't anything better
yes cva is very typesafe
i am loving it
like you can do
className={button({size: "small"})} />
and you get typesafety for each variant?yeah
idk if you mean this
interesting