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

  Рет қаралды 17,108

Cosden Solutions

Cosden Solutions

2 ай бұрын

🚀 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!

Пікірлер: 48
@51Grimz
@51Grimz 2 ай бұрын
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.
@design-with-hannah
@design-with-hannah 2 ай бұрын
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🚀👏
@cosdensolutions
@cosdensolutions 2 ай бұрын
thank you for the kind words!
@Farruh_13
@Farruh_13 2 ай бұрын
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.
@mohammadkhosrotabar2215
@mohammadkhosrotabar2215 Ай бұрын
I really needed this, thank you so much!
@medas4923
@medas4923 2 ай бұрын
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.
@samahgad241
@samahgad241 2 ай бұрын
Easy to follow, thanks aalot Cosden❤
@utibeabasiekpenyong7231
@utibeabasiekpenyong7231 22 күн бұрын
If I keep watching your video I bet it I would be a senior developer soon, You teaching procedure is top rated
@demicoderr
@demicoderr 2 ай бұрын
I'm really anticipating Project React! I really pray it is affordable.
@eca8799
@eca8799 2 ай бұрын
amazing explanation thank you so much
@samrat_malisetti
@samrat_malisetti Ай бұрын
High level stuff ❤
@nemeziz_prime
@nemeziz_prime 2 ай бұрын
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?
@EnesKab
@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
@TheIlkzz
@TheIlkzz 2 ай бұрын
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
@kaswanpradeep
@kaswanpradeep 2 ай бұрын
Can you do one for input element, as it has different types, it would be really awesome if you do it.
@nurpaisorozulbaev7451
@nurpaisorozulbaev7451 2 ай бұрын
Great! Thank you! Do you have any typescript tutorials?
@cosdensolutions
@cosdensolutions 2 ай бұрын
not directly, but all my videos are in TS
@antsii
@antsii 2 ай бұрын
Should've used forwardRef to be able to pass ref?
@cosdensolutions
@cosdensolutions 2 ай бұрын
yeah I could've, but given that it's going to be deprecated, I decided to leave it out. It's easy to add it if needed
@heysahilsingh
@heysahilsingh 2 ай бұрын
I was expecting something different, as this component is too easy to create. I think a dialogue box, a card or something would be better. But still, m gonna like this ❤️
@cosdensolutions
@cosdensolutions 2 ай бұрын
fair point! thanks for the feedback ☺️
@fabianpetersen2452
@fabianpetersen2452 2 ай бұрын
The principle will be the same though,..if you can understand this you will be able to do it for any other component
@cosdensolutions
@cosdensolutions 2 ай бұрын
that was the idea, yes
@sahibibadov
@sahibibadov 2 ай бұрын
react-twc + tailwind-variants the best.
@sae4622
@sae4622 2 ай бұрын
What is difference of using HTMLAttributes and ComponentProps?
@cosdensolutions
@cosdensolutions 2 ай бұрын
not much, I usually use ComponentProps but shadcn uses HTMLAttributes so I decided to use those too!
@hithere7145
@hithere7145 2 ай бұрын
wht your take on nvidia's ceo statement
@naranyala_dev
@naranyala_dev 22 күн бұрын
tanstack, tanstack, tanstack
@d1zzy155
@d1zzy155 2 ай бұрын
Whats difference between HTMLAttributes and ComponentProps
@somtechnology1811
@somtechnology1811 2 ай бұрын
can you make a full project using React and taliwaindcss
@cosdensolutions
@cosdensolutions 2 ай бұрын
That's what Project React is all about 😁
@bugraotken
@bugraotken 9 күн бұрын
Hello Darius, thank you for the video but there is a little problem here. You said that you will provide a repo but there is no repo so I have created my own project with tailwindcss and vite. But the thing is since I was writing the code like you do, there is no color at buttons and I have been looking for 20 mins to find the solution. Finally I found that you typed "from-primary-500 to-primary-700" but since I don't have your repo and I created a project myself, there is no primary color at my project. Oh man, there is nothing wrong with "not sharing a repo" it's totally fine but please next time if you don't provide a repo, pls at least show us all the "non default" things you do in your project like defining primary color for your tailwind.config.js file or just go with default settings so any people who is following your code and create their own projects cause you don't provide one, don't have issues like this =)
@cat-cx7sv
@cat-cx7sv 2 ай бұрын
این نیز بگذرد؟ persian tato nice
@ShivaprasadBilgundi
@ShivaprasadBilgundi 2 ай бұрын
can give any idea on the pricing of the course?
@cosdensolutions
@cosdensolutions 2 ай бұрын
details are coming most likely next week!
@manjaresaskiajamesbacea6268
@manjaresaskiajamesbacea6268 2 ай бұрын
is the project-react course free? thankyouu
@rt7rt790
@rt7rt790 2 ай бұрын
It is a "course" not a tutorial , definitely it'll be a paid one
@user-dc7jb3vk5y
@user-dc7jb3vk5y 2 ай бұрын
There is no need to wright ButtonProps, but only Props, because we understand that it is Button component
@cosdensolutions
@cosdensolutions 2 ай бұрын
Better to write explicit names, in case you need to import in other components
@user-dc7jb3vk5y
@user-dc7jb3vk5y 2 ай бұрын
@@cosdensolutions Yes, but if we want to use type or interface in more then one place I think we should make some types / interfaces folder for this
@cosdensolutions
@cosdensolutions 2 ай бұрын
@@user-dc7jb3vk5y not necessarily, often times you just use one component in the other and still want to allow props to be passed to it, so you just import the type. no need to create anything extra
@islambn8962
@islambn8962 2 ай бұрын
what about ref ? Great content tho 🎉
@cosdensolutions
@cosdensolutions 2 ай бұрын
You can pass it through props! ForwardRef is going away
@user-uk5tj3qn5q
@user-uk5tj3qn5q Ай бұрын
Try tailwind-variant
@hrithikvishwakarma001
@hrithikvishwakarma001 2 ай бұрын
Tell me how will you pass ref?
@cosdensolutions
@cosdensolutions 2 ай бұрын
Through props like any other
@user-qj4rr1rm8i
@user-qj4rr1rm8i 2 ай бұрын
Your Repo is empty.
Single Responsibility Principle in React (Design Patterns)
16:50
Cosden Solutions
Рет қаралды 43 М.
Infinite Pagination Component With React Query
14:58
Cosden Solutions
Рет қаралды 13 М.
Не пей газировку у мамы в машине
00:28
Даша Боровик
Рет қаралды 10 МЛН
Кәріс тіріма өзі ?  | Synyptas 3 | 8 серия
24:47
kak budto
Рет қаралды 1,7 МЛН
СҰЛТАН СҮЛЕЙМАНДАР | bayGUYS
24:46
bayGUYS
Рет қаралды 336 М.
How Shadcn/ui ACTUALLY Works
32:38
Theo - t3․gg
Рет қаралды 81 М.
Common Mistakes and Advanced Typescript Techniques
10:49
Ljupche Vasilev
Рет қаралды 6 М.
10 Tailwind Classes I Wish I Knew Earlier
13:31
Web Dev Simplified
Рет қаралды 154 М.
This UI component library is mind-blowing
8:23
Beyond Fireship
Рет қаралды 547 М.
cn() - Every Tailwind Coder Needs It (clsx + twMerge)
7:46
ByteGrad
Рет қаралды 112 М.
Svelte UI Libraries Have Leveled Up
12:14
Huntabyte
Рет қаралды 50 М.
Designing scalable Compose APIs
19:53
Android Developers
Рет қаралды 8 М.
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 339 М.