Styled Components Full Tutorial - Style Your Components in React

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.ย. 2024
  • ReactJS Styled Components tutorial! In this video I will go over everything you need to know about the library! Styled-Components is a css library in react which allow you to style components very easily!
    -
    🚀 Learn ReactJS By Building 6 Projects: codedamn.com/l...
    💻 PedroTech Discord: / discord
    -
    Social
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    Website: machadopedro.com
    Twitter: / pedrotech_
    Linkedin: / machadop1407
    Instagram: / _pedro.machado_
    Github: github.com/mac...
    Email: machadop1407@gmail.com
    Equipments I Use:
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    🌟 Algorithm Book To Pass Coding Interviews: amzn.to/2Z2CirS
    🌟 Microphone: amzn.to/2MKAm4V
    🌟 Keyboard: amzn.to/3tvU6ZR
    🌟 HD Webcam: amzn.to/3tMpJPD
    🌟 Room LED Lights: amzn.to/3a5mFGp
    Tags:
    - Styled-Components
    - ReactJS Tutorial
    - ReactJS
    #styledcomponents #tutorial #reacttutorial

ความคิดเห็น • 175

  • @MadBlissOff
    @MadBlissOff 2 ปีที่แล้ว +2

    This is the first guy I've seen in my life with an imac and a mechanical keyboard.

  • @bilalch898
    @bilalch898 3 ปีที่แล้ว +37

    You deserve a million subs for sharing such a great knowledge ☺️

  • @chawker67
    @chawker67 3 ปีที่แล้ว +8

    This tutorial won that for me 🏆
    I had issues with most of the stuff you showed and now everything is perfectly clear. What's more you got me motivated so that's another +

  • @kalviyalkarpom4127
    @kalviyalkarpom4127 2 ปีที่แล้ว +2

    No around the bush, No waste of time, Just Did Perfect Job

  • @nirmalkoirala9660
    @nirmalkoirala9660 2 ปีที่แล้ว +6

    Hey Pedro!
    I am starting to learn react as a complete beginner and your video is helping me more than Udemy’s React course. Just finished the portfolio website following yours and now everything seems to make sense. Keep on doing awesome job. Keep the videos coming.
    Thanks million

  • @jaimemedina3351
    @jaimemedina3351 2 ปีที่แล้ว +2

    Nice job! FYI for anyone interested in what's going on under the hood, React is leveraging the Tagged Literals functionality of JavaScript.

  • @mpilodlamini8407
    @mpilodlamini8407 2 ปีที่แล้ว +2

    Excellent tutorial. I am ready to and already applying styled components to my project.
    thank you very much

  • @Sezar_SZ
    @Sezar_SZ 2 ปีที่แล้ว +1

    This was the best video explaining how styled components work. THANK YOU!

  • @jubjubfriend64
    @jubjubfriend64 2 ปีที่แล้ว +1

    5:20 hahaha yes exactly what I was hoping for, just getting started with react and I was reluctant to use styled components due to it all being a string without auto-fill

  • @tech3425
    @tech3425 2 ปีที่แล้ว +7

    15:56 You dont actually need the '&' symbol over there to show nested components. This is a CSS preprocessor called Scss, and it will automatically detect that you have nested the label inside the button. '&' is for copying the parent class name once again, for selectors like :hover, and :active, which dont work without the parent class name.

  • @skyescrawford9774
    @skyescrawford9774 3 ปีที่แล้ว +1

    I'm so grateful because the first video that I see when first time I learn about styled components is yours video, thank you so much

  • @lottexy
    @lottexy 2 ปีที่แล้ว +1

    Amazing, so easy to understand! Tested this on typescript with a bit of googling to figure out the interface and all works great! Thanks pedro!

  • @yamilmsilva
    @yamilmsilva ปีที่แล้ว

    MAN !!!!! You made it look so easy and ABSOLUTELY UNDERSTANDABLE!!!
    Thank you so much. You are the best !!!

  • @user-nf1ww4iq8g
    @user-nf1ww4iq8g ปีที่แล้ว

    If i need some skill's how to use, Pedro always uploaded already. Your best guide I ever met

  • @maxmaksum4673
    @maxmaksum4673 3 ปีที่แล้ว +3

    it is the easiest and the most clear explanation of style component..thank you bro🙏🙏🙏

    • @PedroTechnologies
      @PedroTechnologies  3 ปีที่แล้ว

      Thank you very much! Glad you liked it!

    • @apexroots
      @apexroots 3 ปีที่แล้ว

      @@PedroTechnologies agree, thank you very much

  • @hellofriend3091
    @hellofriend3091 2 ปีที่แล้ว +2

    This is what i was looking for thanks mate

  • @blueb06
    @blueb06 2 ปีที่แล้ว +1

    Thanks....man...this is what exactly I needed.....these days...you are like a savior in my react learning journey !

  • @nicolasturek2413
    @nicolasturek2413 3 ปีที่แล้ว +3

    explained very well, i appreciate you going through the small nuances and giving us reference examples!

  • @craigbarber3046
    @craigbarber3046 ปีที่แล้ว

    & is called ampersand 😉 Literature major transitioning into tech. Great job! Thanks for posting. I'm collaborating with a friend and he asked me to use styled components instead of inline styling and now I feel like I can get started.

  • @limitless9483
    @limitless9483 2 ปีที่แล้ว +1

    you can use that vscode plugin that help you rename your jsx tags

  • @jamesdaniel597
    @jamesdaniel597 2 ปีที่แล้ว +1

    Nice rundown of styled components

  • @sarahcalbez7104
    @sarahcalbez7104 2 ปีที่แล้ว +1

    Seriously, thank you a lot for this video!

  • @royz_1
    @royz_1 3 ปีที่แล้ว +1

    Loved the video. But in case you didn't know, styled-components uses SCSS. that's how it's providing all these extra functionalities.

  • @brandaoerick
    @brandaoerick 2 ปีที่แล้ว

    I love the way you've approached this topic! Well done, bro!

  • @andarlin5312
    @andarlin5312 2 ปีที่แล้ว +1

    Great video! Very informative!

  • @mikheilbeldishevski2776
    @mikheilbeldishevski2776 ปีที่แล้ว

    Thank you so much, you have answered so many questions I had. Thanks again.

  • @sanvedbhoyar
    @sanvedbhoyar 2 ปีที่แล้ว

    at 20:20 the reason why you have to pass className as props might be because styled components generates random classNames for us when we style a component...
    So when you styled the Button component, you essentially styled element of html.. and styled component automatically generated a random className for when you created component...
    Which is why I think this might be the reason you have to de-structure className prop in Button component so we can apply the styles from random className generated by styled components. Hope this helps

    • @leg875
      @leg875 ปีที่แล้ว

      I had the same query while watching the video. Thanks. Today I learned something new that after watching a video spend few mins to read through the youtube comments ;)

  • @caffeinated-pixels
    @caffeinated-pixels 3 ปีที่แล้ว +1

    Cheers dude, this is a great introduction to using styled-components. It's helped me a lot!

  • @MrAndykofi
    @MrAndykofi 2 ปีที่แล้ว +1

    Nice, enjoyed your lectures please keep up with the good work.

  • @zafarhussain8273
    @zafarhussain8273 3 ปีที่แล้ว +1

    one of th best video on styeld comp. i realy appriciate your effort

  • @varaprasad4163
    @varaprasad4163 3 ปีที่แล้ว +4

    hey Pedro! could you please make a video on testing components? thanks.

  • @peshutanpavri1599
    @peshutanpavri1599 2 ปีที่แล้ว +1

    Hey great tutorial. What's your opinion on this vs emotion?

  • @pjguitar15
    @pjguitar15 3 ปีที่แล้ว +1

    This makes code looks so clean

    • @PedroTechnologies
      @PedroTechnologies  3 ปีที่แล้ว

      Yess! I absolutely love projects structured using styled components!

  • @willvonarend
    @willvonarend 3 ปีที่แล้ว +4

    Hi, thanks for that. How would you approach using CSS variables with Styled Components? So having a '--primary-color' for example

  • @ayushdedhia25
    @ayushdedhia25 3 ปีที่แล้ว +3

    So basically it follows the scss syntax to style our components... Right!? 😅😅

  • @thearong_5853
    @thearong_5853 3 ปีที่แล้ว

    best video for beginner

  • @eliasimokhai
    @eliasimokhai 3 ปีที่แล้ว +2

    You made it easy...thank you

  • @cyriljephery2662
    @cyriljephery2662 ปีที่แล้ว

    Thank you so much... definitely subscribing

  • @joaohelio2925
    @joaohelio2925 2 ปีที่แล้ว +1

    How can I use the link with styled- Components?

    • @worldclasscode1847
      @worldclasscode1847 2 ปีที่แล้ว

      You can keep the tag, and put a styled div around it. My link. Then in the styled code you use the ".mytag" class selector to address the class and inject the CSS :)

  • @antrahagure5372
    @antrahagure5372 ปีที่แล้ว

    Thanks for video!
    Hiw to nest elopement in Styles ,like ul, li, a , hover ?
    In Sass nesting is easy but I couldn't understand how to do it with Stuled.

  • @tsdineshjai8565
    @tsdineshjai8565 3 ปีที่แล้ว

    learnt a lot at first go with this tutorial. Kudos Man !

  • @balazsbereczky595
    @balazsbereczky595 3 ปีที่แล้ว +1

    it's a good summary, thanks!

  • @jordanmolina2351
    @jordanmolina2351 3 ปีที่แล้ว +1

    really easy to understand and helpful thanks

  • @petarstrbad7191
    @petarstrbad7191 3 ปีที่แล้ว +1

    Awesome video, and most useful so far, thank you man! :D

  • @Anopeng
    @Anopeng 2 ปีที่แล้ว

    It's the best explanation for me, thank you very much!

  • @benyaminyakobi3652
    @benyaminyakobi3652 3 ปีที่แล้ว +1

    That's a pure gold knowledge!

  • @musicmoi
    @musicmoi 3 ปีที่แล้ว

    So happy I found this channel. 💓

  • @mahfuzulhasan3108
    @mahfuzulhasan3108 ปีที่แล้ว

    Explained very well, I appreciate it, keep it up

  • @AntiPseudoPhilosopher
    @AntiPseudoPhilosopher 3 ปีที่แล้ว +2

    Muito legal. Abriu muito a minha mente. Obrigado!

  • @voncedrickbriones3995
    @voncedrickbriones3995 3 ปีที่แล้ว +1

    Why styled-components extension didn't work on my project? Can you help me how to fix that?

  • @thevloglife105
    @thevloglife105 3 ปีที่แล้ว +1

    Very nice. But you need to upload video regarding node-sass scss compile to css.

  • @balanepalaiyathane9714
    @balanepalaiyathane9714 2 ปีที่แล้ว +1

    Simple and very effective

  • @mayurghuge8846
    @mayurghuge8846 2 ปีที่แล้ว +1

    Thank you.

  • @psicotrogato
    @psicotrogato ปีที่แล้ว

    just clever as always.. thanks

  • @danielfarkas2689
    @danielfarkas2689 3 ปีที่แล้ว +1

    Clean and understandable! Thank you!

  • @ezbitz23
    @ezbitz23 2 ปีที่แล้ว

    Thanks! Very useful content. Clear & concise.

  • @Deprecated446
    @Deprecated446 3 ปีที่แล้ว +1

    Super helpful, thanks!

  • @sonnix31
    @sonnix31 2 ปีที่แล้ว +1

    Excellent.

  • @worldclasscode1847
    @worldclasscode1847 2 ปีที่แล้ว

    Awesome! I also use this in every project :)

  • @johndoggett4657
    @johndoggett4657 3 ปีที่แล้ว

    Good tutorial man. Loved it. Some of the concepts remind me of Sass.

  • @rustamov_vlogs
    @rustamov_vlogs 3 ปีที่แล้ว +1

    Amazing as always, thank you 😊

  • @yugsoni2603
    @yugsoni2603 3 ปีที่แล้ว +1

    thank you so much.

  • @DaveTradeFx_01
    @DaveTradeFx_01 3 ปีที่แล้ว +2

    Can you make a video with data virtualization such as graph ... with react js

    • @PedroTechnologies
      @PedroTechnologies  3 ปีที่แล้ว

      Yes I was already planning on a video on data visualization, so it will come out soon!

  • @josephwong2832
    @josephwong2832 3 ปีที่แล้ว

    great tutorial i subbed

  • @chaswards
    @chaswards 3 ปีที่แล้ว +3

    Great video! Very informative! How would you say styled components compares to using CSS modules?

    • @PedroTechnologies
      @PedroTechnologies  3 ปีที่แล้ว +2

      Thank you! I prefer styled-components becaause i believe it makes it easier for large companies to divide the work (ux/ui make the components and the frontend devs just use them). But both ways work well!

    • @chaswards
      @chaswards 3 ปีที่แล้ว

      @@PedroTechnologies That makes sense, thanks!

  • @Angels2welcome
    @Angels2welcome 2 ปีที่แล้ว

    I loved the video you are such a good teacher! Can you make a video explaining how can I import fonts and use it in styled componets?

    • @jpcc1223
      @jpcc1223 ปีที่แล้ว

      to use it, you need to import the font you want into your index.html file. After importing (for example, from google fonts), you can use it anywhere in you app

  • @ThColinPereira
    @ThColinPereira 3 ปีที่แล้ว +1

    Amazing video! It helped me a lot!!

  • @securitytechtalk
    @securitytechtalk 3 ปีที่แล้ว

    thnx sir this tutorial is very useful for me

  • @stevenchung934
    @stevenchung934 3 ปีที่แล้ว

    Super helpful, thanks man!

  • @0xPanda1
    @0xPanda1 3 ปีที่แล้ว

    very nice explanation , thank you very much

  • @leo-fv2nv
    @leo-fv2nv 3 ปีที่แล้ว

    can u share code that could b more helpful and it saves time.......i am happy with ur teaching.

  • @nwabuzorchukwuemekaobiora7361
    @nwabuzorchukwuemekaobiora7361 3 ปีที่แล้ว

    This was super helpful.... 🔥🔥🔥🔥

  • @karthikkhoday5555
    @karthikkhoday5555 3 ปีที่แล้ว +2

    Can you tell me which extendion is used to show the file size next to import statements...

  • @live_emulator
    @live_emulator ปีที่แล้ว

    im really curious how responsiveness can apply to styled components or media querys.

  • @sonamohialdin3376
    @sonamohialdin3376 2 ปีที่แล้ว

    So good tutorial

  • @nikoletahroncova3342
    @nikoletahroncova3342 3 ปีที่แล้ว

    very good video, thank you very much for sharing!

  • @Ram-ry2sd
    @Ram-ry2sd 3 ปีที่แล้ว

    Very nice! it's really simple! Thank you! But what about animations, media queries and browser prefixes?

  • @AbdulRehman-vj7xu
    @AbdulRehman-vj7xu ปีที่แล้ว

    nice bro good to help me

  • @trered21
    @trered21 ปีที่แล้ว

    mine doesnt work help please. its not reading any of my commands from styled. it also doesnt auto fill elements so im assuming my package is bad but it is definitely installed

  • @francescoPace27
    @francescoPace27 ปีที่แล้ว

    Ty very usefull!

  • @indiedy_ghaze0968
    @indiedy_ghaze0968 2 ปีที่แล้ว +2

    Is this what I use for to syle my apps on andriod or ios?

    • @PedroTechnologies
      @PedroTechnologies  2 ปีที่แล้ว +1

      You can use this for react native as well, so yes!

    • @indiedy_ghaze0968
      @indiedy_ghaze0968 2 ปีที่แล้ว

      @@PedroTechnologies Thank you so much! Thank you!

  • @ashishthapa7768
    @ashishthapa7768 3 ปีที่แล้ว +1

    Well I watched your login with session video but i am getting issue on redirecting to profile dashboard so...I wish u will make solution on redirecting to profile dashboard after login much appreciate till yet.Thank You:-)

    • @PedroTechnologies
      @PedroTechnologies  3 ปีที่แล้ว

      In react you can have a promise after the fetch request and use the useHistory hook in react router dom to redirect. I have a video explaining this: th-cam.com/video/o__czqXJtqk/w-d-xo.html

  • @irfanbaloch2884
    @irfanbaloch2884 2 ปีที่แล้ว

    Awesome content

  • @ampomahwinston3436
    @ampomahwinston3436 3 ปีที่แล้ว

    How do you handle media query on styled component

  • @PB3073
    @PB3073 3 ปีที่แล้ว +1

    Valeu!

  • @joicyjoy9658
    @joicyjoy9658 11 หลายเดือนก่อน

    You rocked

  • @touseefahmad9794
    @touseefahmad9794 2 ปีที่แล้ว +1

    which is better withStyles or Styled???

  • @mohamedyoussef8835
    @mohamedyoussef8835 2 ปีที่แล้ว +1

    Awesome ++++++++++++++ 🙂🙂

  • @User-em7fh
    @User-em7fh ปีที่แล้ว

    good tutorial 8.78/10

  • @CH3THIN
    @CH3THIN 3 ปีที่แล้ว

    This is really good

  • @divance
    @divance 3 ปีที่แล้ว

    Anyone here can tell what plugin is using to show the size of the npm package ?

  • @umerfarooq3121
    @umerfarooq3121 3 ปีที่แล้ว +1

    Yeah Styled Components is awesome ;)

    • @PedroTechnologies
      @PedroTechnologies  3 ปีที่แล้ว

      I love it! I use it in every single project!

    • @umerfarooq3121
      @umerfarooq3121 3 ปีที่แล้ว

      @@PedroTechnologies That's great

  • @rowdypiper6172
    @rowdypiper6172 3 ปีที่แล้ว

    thank u

  • @dleonardo8755
    @dleonardo8755 3 ปีที่แล้ว

    first line in 10:43 what is the green text? how i can see this in my code

  • @swiveiproduction9192
    @swiveiproduction9192 3 ปีที่แล้ว +1

    would you recommend us to use styled components or CSS modules?

  • @barca6097
    @barca6097 3 ปีที่แล้ว

    Thanks a lot ❤

  • @briandacallos4234
    @briandacallos4234 2 ปีที่แล้ว

    Definitely he has a blood of legendary bucky roberts.

  • @jakkenfive
    @jakkenfive 3 ปีที่แล้ว +1

    Great video, Pedro how old are you?

  • @samatzhussipov1139
    @samatzhussipov1139 3 ปีที่แล้ว +1

    css in js or css modules which need choose for reactjs ?

    • @PedroTechnologies
      @PedroTechnologies  3 ปีที่แล้ว +1

      Both are good, I like using styled components more!

  • @rangabharath4253
    @rangabharath4253 3 ปีที่แล้ว +1

    awesome as always :-)