Build a Reusable Component in React (Shadcn/ui, Tailwind)

23,212
0
Published 2024-03-13
šŸš€ Project React ā†’ cosden.solutions/project-react
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)
  • @51Grimz
    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šŸš€šŸ‘
  • @Farruh_13
    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
  • @ronaldos3738
    Great job dude, new subs, thanks for the knowledge
  • @eca8799
    amazing explanation thank you so much
  • @medas4923
    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.
  • @demicoderr
    I'm really anticipating Project React! I really pray it is affordable.
  • @nemeziz_prime
    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?
  • @TheIlkzz
    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
  • @EnesKab
    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
  • @kaswanpradeep
    Can you do one for input element, as it has different types, it would be really awesome if you do it.
  • @psrs985
    why cant we use clsx directly instead of cva
  • @antsii
    Should've used forwardRef to be able to pass ref?