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

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 62

  • @Farruh_13
    @Farruh_13 8 місяців тому +17

    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.

  • @design-with-hannah
    @design-with-hannah 8 місяців тому +11

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

  • @utibeabasiekpenyong7231
    @utibeabasiekpenyong7231 6 місяців тому

    If I keep watching your video I bet it I would be a senior developer soon, You teaching procedure is top rated

  • @benalpha2297
    @benalpha2297 17 днів тому

    Thank you for helping me understand the bunch of code that shadcn/ui generated.

  • @51Grimz
    @51Grimz 8 місяців тому +1

    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.

  • @medas4923
    @medas4923 8 місяців тому +6

    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.

    • @01dom
      @01dom 3 місяці тому +1

      Ty

    • @kalideb-y3y
      @kalideb-y3y 2 місяці тому

      you should have put the time of what part of the video you're referring to

  • @Mobilemaniaplays
    @Mobilemaniaplays 2 місяці тому

    Your teaching method is very good. Love from india sir

  • @EnesKab
    @EnesKab 7 місяців тому +1

    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

  • @redhack8696
    @redhack8696 Місяць тому +1

    I think I'm on the UA-cam premium 🙌❤

  • @mohammadkhosrotabar2215
    @mohammadkhosrotabar2215 8 місяців тому

    I really needed this, thank you so much!

  • @samahgad241
    @samahgad241 8 місяців тому

    Easy to follow, thanks aalot Cosden❤

  • @eca8799
    @eca8799 8 місяців тому

    amazing explanation
    thank you so much

  • @mindblower113
    @mindblower113 3 місяці тому +1

    Thank you so much 🎉🎉

  • @abdrahman-d7
    @abdrahman-d7 2 місяці тому

    it will also be more beneficial to enable component to accept ref using forwardRef

  • @ronaldos3738
    @ronaldos3738 5 місяців тому

    Great job dude, new subs, thanks for the knowledge

  • @TomaszOstroga
    @TomaszOstroga 2 місяці тому

    Well explained, exactly what I needed. You have mentioned that there is a link to the repo in the desc but cannot find it there nor in your gh.

  • @leonscander1431
    @leonscander1431 3 місяці тому

    What if I want to make as an underlying type of a button?

  • @nemeziz_prime
    @nemeziz_prime 8 місяців тому

    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?

  • @samrat_malisetti
    @samrat_malisetti 7 місяців тому

    High level stuff ❤

  • @heysahilsingh
    @heysahilsingh 8 місяців тому +1

    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  8 місяців тому

      fair point! thanks for the feedback ☺️

    • @fabianpetersen2452
      @fabianpetersen2452 8 місяців тому

      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  8 місяців тому

      that was the idea, yes

  • @TheIlkzz
    @TheIlkzz 8 місяців тому

    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 8 місяців тому

    Can you do one for input element, as it has different types, it would be really awesome if you do it.

  • @psrs985
    @psrs985 5 місяців тому

    why cant we use clsx directly instead of cva

  • @antsii
    @antsii 8 місяців тому +1

    Should've used forwardRef to be able to pass ref?

    • @cosdensolutions
      @cosdensolutions  8 місяців тому +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

  • @nurpaisorozulbaev7451
    @nurpaisorozulbaev7451 8 місяців тому

    Great! Thank you! Do you have any typescript tutorials?

    • @cosdensolutions
      @cosdensolutions  8 місяців тому +1

      not directly, but all my videos are in TS

  • @julienheng3880
    @julienheng3880 5 місяців тому

    can you achieve this without typescript?

  • @sahibibadov
    @sahibibadov 8 місяців тому +3

    react-twc + tailwind-variants the best.

  • @PavelFedorov-x4c
    @PavelFedorov-x4c 8 місяців тому

    There is no need to wright ButtonProps, but only Props, because we understand that it is Button component

    • @cosdensolutions
      @cosdensolutions  8 місяців тому

      Better to write explicit names, in case you need to import in other components

    • @PavelFedorov-x4c
      @PavelFedorov-x4c 8 місяців тому

      @@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  8 місяців тому +1

      @@PavelFedorov-x4c 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

  • @sae4622
    @sae4622 8 місяців тому +1

    What is difference of using HTMLAttributes and ComponentProps?

    • @cosdensolutions
      @cosdensolutions  8 місяців тому +1

      not much, I usually use ComponentProps but shadcn uses HTMLAttributes so I decided to use those too!

  • @hithere7145
    @hithere7145 8 місяців тому

    wht your take on nvidia's ceo statement

  • @navaneeth9103
    @navaneeth9103 5 місяців тому

    how to setup cli install

  • @d1zzy155
    @d1zzy155 8 місяців тому

    Whats difference between HTMLAttributes and ComponentProps

    • @01dom
      @01dom 3 місяці тому

      I believe html does not include ref and key

  • @islambn8962
    @islambn8962 8 місяців тому +1

    what about ref ?
    Great content tho 🎉

    • @cosdensolutions
      @cosdensolutions  8 місяців тому

      You can pass it through props! ForwardRef is going away

  • @ShivaprasadBilgundi
    @ShivaprasadBilgundi 8 місяців тому

    can give any idea on the pricing of the course?

    • @cosdensolutions
      @cosdensolutions  8 місяців тому +1

      details are coming most likely next week!

  • @somtechnology1811
    @somtechnology1811 8 місяців тому

    can you make a full project using React and taliwaindcss

    • @cosdensolutions
      @cosdensolutions  8 місяців тому +1

      That's what Project React is all about 😁

  • @bugraotken
    @bugraotken 6 місяців тому

    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 =)

  • @hrithikvishwakarma001
    @hrithikvishwakarma001 8 місяців тому

    Tell me how will you pass ref?

  • @manjaresaskiajamesbacea6268
    @manjaresaskiajamesbacea6268 8 місяців тому

    is the project-react course free? thankyouu

    • @rt7rt790
      @rt7rt790 8 місяців тому +1

      It is a "course" not a tutorial , definitely it'll be a paid one

  • @cat-cx7sv
    @cat-cx7sv 8 місяців тому +1

    این نیز بگذرد؟
    persian tato
    nice

  • @ПетрПетров-ж9е
    @ПетрПетров-ж9е 7 місяців тому

    Try tailwind-variant

  • @muhammedsahad1612
    @muhammedsahad1612 3 місяці тому

    Through this reusable component we get the prop drilling 😢

  • @naranyala_dev
    @naranyala_dev 6 місяців тому

    tanstack, tanstack, tanstack