Тёмный

The Essential Guide to Material-UI Styled Components (MUI v5) 

The Clever Dev
Подписаться 2,1 тыс.
Просмотров 30 тыс.
50% 1

Опубликовано:

 

3 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 51   
@ThomasKupracz
@ThomasKupracz 2 года назад
Just wanted to thank you for taking the time to make this video. I'm using MUI5 and I almost threw my laptop out the goddamn window trying to understand why makeStyles wasn't working. Guess it's my bad for watching a tutorial older than a year ;) Again, thank you!
@thecleverdev5315
@thecleverdev5315 2 года назад
I'm glad it helped! I also had those moments when I first started using MUI.
@AndriusLau
@AndriusLau 2 года назад
So much confusion with V5 changes :D I used it a few times with V4 and now I need again to learn new features. Great video.
@jonmiddaugh7533
@jonmiddaugh7533 2 года назад
Yeah, MUI is a pretty big library. In my opinion, v4 -> v5 was a big improvement and definitely worth putting some time into learning the new APIs.
@learner8084
@learner8084 Год назад
Thanks, this is very good. I appreciate your efforts to explain so clearly. I have a suggestion. May be you could consider cut/paste and I believe the video would flow a little better.
@wolf7115
@wolf7115 2 года назад
Hey thanks! I've been having a hard time understanding the docs in regards to this so my entire project was filling up with the sx command, which I would like to limit. Your video made this much easier to understand.
@thecleverdev5315
@thecleverdev5315 2 года назад
Glad it helped!
@kevinmuhlbach5247
@kevinmuhlbach5247 2 года назад
Really appreciate you putting up some mui v5 tutorials! If you ever offered a udemy course I'd buy it in a heartbeat. It's hard to find resources or figure out the docs for some things with a new release.
@thecleverdev5315
@thecleverdev5315 2 года назад
You are welcome, these have been fun to create! There is a Udemy course dedicated to MUI, I didn't create it but I included a (affiliate) link in this video's details. It is great content and tons of value (40+ hours and a low price as Udemy goes). However, the creator made it for MUI v4 and he last told me he planned to update it for v5 in March. The biggest changes for v5 are the sx API, the styled API, and the stack component for layout. I have a tutorial for each at my site, smartdevpreneur.com/, and a video for each on this channel. If you take the Udemy course and review the new APIs that I wrote about, you should have a strong knowledge of MUI.
@thecleverdev5315
@thecleverdev5315 2 года назад
I just finished creating a course on Udemy! Check it out here: www.udemy.com/course/advanced-material-ui-component-styling-the-complete-course/?referralCode=4BF967AA38E8C00D52A4
@lycan2494
@lycan2494 2 года назад
@@thecleverdev5315 hi i bought the course! looking forward to learning advance mui! reading the docs got me tearing my hair out
@thecleverdev5315
@thecleverdev5315 2 года назад
@@lycan2494 Awesome! Your support means a ton, and I believe the course will deliver incredible value for you. There's a Q&A feature in Udemy, reach out to me there if you have any questions!
@joaquincartagenavillarroel8856
@joaquincartagenavillarroel8856 2 года назад
thanks man. saved me a lot of headaches
@thecleverdev5315
@thecleverdev5315 2 года назад
I'm glad to hear it was helpful!
@vishwachikate
@vishwachikate Год назад
Thank you for this 🙏
@stanislavschaefer3233
@stanislavschaefer3233 Год назад
What's the difference between import { styled } from '@mui/material' and import { styled } from '@mui/system'?
@akshaygadekar9926
@akshaygadekar9926 2 года назад
You can also import styles utility from mui styles
@thecleverdev5315
@thecleverdev5315 2 года назад
Good callout!
@psyferinc.3573
@psyferinc.3573 2 года назад
you chose to go into details in this stuff can i ask why? btw much appreciated .
@thecleverdev5315
@thecleverdev5315 Год назад
Because it's the best way to help people learn the content!
@enzobatista2904
@enzobatista2904 2 года назад
It is possible to manage components props so you could have conditional styles based on props like styled-components ?
@DominicJuhn
@DominicJuhn 2 года назад
Thank you for this very helpful
@thecleverdev5315
@thecleverdev5315 2 года назад
I'm glad you liked it!
@pareshsolanki929
@pareshsolanki929 2 года назад
Thank You for this video very helpful, can you do same with MUI select and change the css for the chained classes MuiMenulist-root-MuiMenu-list
@victormog
@victormog 2 года назад
Tell about props in MUI 5, please. And how can access to the breakpoints into React components?
@thecleverdev5315
@thecleverdev5315 2 года назад
Hi Victor, I have two videos that might help. This one shows how to use the new 'sx' styling API (including how to use it with breakpoints): ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-zV-jDJx6XjI.html This one is an example of breakpoints being used on the Grid: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-B7rDus0sMRw.html
@victormog
@victormog 2 года назад
@@thecleverdev5315 Thank you!
@jonasbalsys3696
@jonasbalsys3696 2 года назад
How to pass props to styled?
@assk477
@assk477 2 года назад
awesome love you :)
@prionkor
@prionkor 2 года назад
Thanks for the video. Subscribed to your channel :)
@thecleverdev5315
@thecleverdev5315 2 года назад
Thanks for the sub!
@adi_sekar
@adi_sekar 2 года назад
Excellent video. Usually I wrap my components to extend the base MUI library, so I will have control over props passed and styling, but it seems that is not needed, and we can achieve all this using theme? Or is it still best practice to wrap MUI components to create our version of say MUI-Button etc? Thanks!
@thecleverdev5315
@thecleverdev5315 2 года назад
You can use the theme or wrap components using the styled API and still pass props. Which one to use depends on the situation and your goals, but theme is most abstract. I made this video showing examples of when to use theme, style API, or sx prop: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-jlHXgu38amM.html
@adi_sekar
@adi_sekar 2 года назад
It seems the styled components string method, does not have intellisense? So the js method is better
@thecleverdev5315
@thecleverdev5315 2 года назад
Styled components can also be created with JS syntax and intellisense. Take a look at the emotion docs here: emotion.sh/docs/styled#object-styles
@mattmarkus4868
@mattmarkus4868 2 года назад
Do you have a video that covers the other (sx) way?
@jonmiddaugh7533
@jonmiddaugh7533 2 года назад
Hi Matt, I do: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-zV-jDJx6XjI.html
@MZ-yx8eg
@MZ-yx8eg 2 года назад
How to pass props ?
@thecleverdev5315
@thecleverdev5315 2 года назад
Hi M Z, I updated the code linked in the video details to include passing props to Styled Components. They can be accessed using an arrow function. Here's the link to my example: smartdevpreneur.com/material-ui-styled-components/#Passing_Props_to_Styled_Components
@alpayk9328
@alpayk9328 2 года назад
Thank you for the video . I would like to ask how can you call the element from another component. For example in styled component we can create different element with custum styles and callthem by import anywhere in the project. How can we call in MUI . Thank you
@thecleverdev5315
@thecleverdev5315 2 года назад
That's exactly what you would do in MUI. Follow the link in the video details, I have a working example that imports a component that uses the styled() API.
@superchrishovids
@superchrishovids 2 года назад
How do you use the theme in both situations? And also, how do you pass in component props to the sc?
@thecleverdev5315
@thecleverdev5315 2 года назад
Hi Christopher, I updated the code linked in the video details to include passing props to Styled Components. They can be accessed using an arrow function. Here's the link to my example: smartdevpreneur.com/material-ui-styled-components/#Passing_Props_to_Styled_Components Theme can be accessed in a similar way. Wrap the component in a theme provider, then the theme will be available to the styled API using an arrow function. See this example from the docs: mui.com/system/styled/#using-the-theme
@devdive24
@devdive24 2 года назад
How can I pass the props to the styledPaper? if can then how to use that?
@thecleverdev5315
@thecleverdev5315 2 года назад
Great question! I updated the code that is linked in the video details. It now includes an example of passing a prop to the styled API. The short answer is that props can be accessed using an arrow function. smartdevpreneur.com/material-ui-styled-components/#Passing_Props_to_Styled_Components
@prakashbesra9205
@prakashbesra9205 2 года назад
What's the use of color attribute above in style?
@thecleverdev5315
@thecleverdev5315 2 года назад
Good question. It will set the color of text in the StyledPaper component. It's not actually affecting anything in the video, I originally had some text that I replaced with a button.
@kshitijlad2414
@kshitijlad2414 2 года назад
what is the replacement for makestyles in mui5 ?
@thecleverdev5315
@thecleverdev5315 2 года назад
The new `sx` prop is the primary replacement. The styled() API is also a replacement but generally used for creating exported components.
@kshitijlad2414
@kshitijlad2414 2 года назад
const useStyles = makeStyles((theme) => ({ - root: { - display: 'flex', - alignItems: 'center', - borderRadius: 20, - background: theme.palette.grey[50], - }. What shall we replace here
@greenshaheen6716
@greenshaheen6716 2 года назад
plz bark properly we are unable to listen
Далее
Customizing the new Material UI
1:12:32
Просмотров 35 тыс.
小路飞嫁祸姐姐搞破坏 #路飞#海贼王
00:45
Сколько стоит ПП?
00:57
Просмотров 319 тыс.
КОГДА НАКРОШИЛ НА ПОЛ #shorts
00:19
MUI V5: The SX Prop
13:55
Просмотров 27 тыс.
The Value of Source Code
17:46
Просмотров 60 тыс.
The Ultimate Guide to the MUI 'sx' Prop
22:06
Просмотров 11 тыс.
小路飞嫁祸姐姐搞破坏 #路飞#海贼王
00:45