Build a Reusable Component in React (Shadcn/ui, Tailwind)
23,212
Published 2024-03-13
Join The Discord! ā discord.cosdensolutions.io/
VSCode Theme | Font ā Material Theme Darker | Menlo, Monaco "monospace"
In this video we will be building a component in React that is similar to shadcn/ui. We will be using tailwind, cva (class-variance-authority), and clsx for this. The component will be reusable, customizable, and will be a simpler version of what shadcn/ui offers. Through this video you will learn how to build production ready UI components that you can use in your projects. You'll also be able to easily understand shadcn/ui's components and integrate them in your own project
All Comments (21)
-
What a quality video! It is great to show how to make reusable components built on top of base html elements. I like the little things like the smooth mouse movement.
-
Great video with a ton of free value on React. And being in the design space, I love Tailwind. I can tell you'll be at 100k subscribers soon, the helpful content and production is on pointšš
-
I really needed this, thank you so much!
-
Please make a video demonstrating how to animate components on mounting and unmounting without any animation library, like shadcn ui does. Shadcn ui animates components with tailwindcss-animate plugin, by using data attributes.
-
If I keep watching your video I bet it I would be a senior developer soon, You teaching procedure is top rated
-
Easy to follow, thanks aalot Cosdenā¤
-
Great job dude, new subs, thanks for the knowledge
-
amazing explanation thank you so much
-
Instead of copying the buttonVariant type to the props, you could infer it with the help of VariantProps like this: VariantProps
and you won't need to touch props ever again, even if you later decide to add an additional variant or a new class. -
I'm really anticipating Project React! I really pray it is affordable.
-
High level stuff ā¤
-
This amazing š„ Could you also do a video where you show how one can make their custom production ready UI component library using Storybook, Tailwind and say Shad CN UI?
-
Is there a way to do the merge with other component/css libraries? I like this setup but we donāt use tailwind at work for example. We use bootstrap so would be awesome to do something similar
-
Hey Darius ! That's a great one as usual ! Can we also make a video combining this with an headless UI like Radix? So we can fully understand how to develop our very own library and components from scratch with primitives. I know you already explained the tricky part here, but you know newbies like me, we all ask for more... š Btw I have checked Project React and it seems really promising. What kept me back for that course is the lack of NextJS. I know the importance of a good React knowledge to work comfortably with NextJS, but also we all know that NextJS is something else. It has it's own interesting and tricky parts like caching for example. So, if you could add NextJS into the pack as an extension, that would be great ! On the other hand it is a great decision to keep the TypeScript out in the course ! Thank you for that
-
Great! Thank you! Do you have any typescript tutorials?
-
Can you do one for input element, as it has different types, it would be really awesome if you do it.
-
how to setup cli install
-
can you achieve this without typescript?
-
why cant we use clsx directly instead of cva
-
Should've used forwardRef to be able to pass ref?