- Podcasts
- ReactJS Developers Podcast
- Material UI (MUI) Crash Course | Build Beautiful React JS Interfaces
Material UI (MUI) Crash Course | Build Beautiful React JS Interfaces
ReactJS Developers Podcast
- December 3, 2026
- 1 h 6 min
- Episode 22
About this episodeWant to build professional-looking React applications without designing every component from scratch? Material UI (MUI) provides a…
- What Material UI (MUI) is and why React developers use it.
- How to install and configure Material UI in a React project.
- Understanding the MUI component library.
- Working with buttons, text fields, cards, and other UI components.
- Creating responsive layouts using MUI Grid and Box.
- Styling React components with the MUI styling system.
- Customising component appearance and themes.
- Building consistent and reusable user interfaces.
- Improving development speed with ready-made components.
- React JS beginners.
- Frontend developers interested in modern UI development.
- React developers who want to build professional interfaces faster.
- Students learning component libraries and responsive design.
- Developers building dashboards and web applications with React.
Transcript
From the publisherThis transcript comes from the podcast’s own feed, shown as the publisher wrote it.
Material UI (MUI) Crash Course | Build Beautiful React JS Interfaces
Now we are going to talk about Material UI and we will completely explore Material UI. We will go to proper documentation, how to read documentation, how to install, how to take components, how to use templates, etc. We will discuss everything in detail. But before that, there are some important things, some lines I have written for you here, which is very important for you to keep in mind. People are very confused about MUI and Material UI these days, because a lot has been updated in it. But you don't have to, there are some 2-4 lines, give me 2 minutes, I will explain everything and then we will go to the direct code. So first of all, you know that material UI rebranded itself to MUI. Means material UI has rebranded itself, now we will call it MUI. First it was material UI, now you will call it MUI. Many things have been added in MUI, packages have been added. So material UI, your UI system, here you have many things, So, you will call it MUI. Inside MUI, you will get the package of Material UI. You will install it and work. So, it is Material UI. Basically, its website has been rebranded. Earlier, it was MaterialUI.com. Now, it is MUI.com. The first point is clear to you. Rest, if you go to documentation, everything will be clear to you. Second point is that MUI components are written as react components. Pure react not plain HTML CSS. So you can say that MUI is completely react based. So if you want to work on react, then you may get a better library than this. But this is much better. It is approached in production. It is a standard in industry. It is used a lot in industry. So you will use a lot of material UI if you learn it once. And you can make strong layouts with it. So the special thing is that it is React based. It uses React components. Pure React. And it also follows props, state, hooks, syntax, whatever you were doing in normal React in the same way. So there will be no confusion. Once you read the documentation, you will know how to work. So it is very interesting. Material UI is developed by an independent open source team. Now I am telling this because many people have such Google has developed it, but it is not like that. It was developed independently by the open source team. It is currently being managed and maintained by the MUI company. The community is very large. Why do people say that it was developed by Google? Because here MUI is based on Google's material design guidelines. This is just the MUI, which is the complete component library of React. It is basically based on Google's material design guidelines. Or you can say it is based on the principles of Google material design. That's why many people understand that it is made by Google. It is not like that. The material design in Google, you can also see the look of Google. There are different applications of Google, you will see its look. So there the material UI design, like material icons, You must have seen different themes in the phone. This is the material pack, this is its. So, the material UI guidelines that were made by Google, it just uses it. MUI. Okay. And this is more special because of this. But it is not that it was made through Google. It is not like that at all. MUI is a complete React component library. Where you get a very good community. And it is being maintained. Even now, updates keep coming. The community is very big in this. So, you can use it in production easily. Without getting hiccups. Community is very important. If you are not getting updates, that means whatever programming language you are using, whether you are using a library or a framework, then it is dead if you are making a project and it is not getting updates. Now, if you talk about Python, then a very large community works on Python. It is still working and updates keep coming. So, you use Python, JavaScript, because the community is very good. That's why we are going to use the Material UI because its community is also very good and it is being maintained. You always get very strong features in it. So, MUI is based on Google's Material Design Guidelines. I have told you this. Now, this last point, I will take you to the documentation first and then I will explain. So, if I search for Material UI here, then you will have the MUI.com site open here. Basically, the site will be open, you have to open it here. So now search for material UI or MUI. You will find it better to search for MUI. Search for MUI. Remember, MUI, not material UI. MUI. So here you can see a library of React components, so I click on it. So here you can see ready to use material, design components, material UI is an open source React component library that implements all these things. So you can make a lot of things in this way. You can make all these components. You will get to know a lot of things. So, we will click on get started. Wait a minute. This is the official homepage. I searched for material UI and it opened the material UI directly. So, you can search for MUI app. So, you get more things in MUI.com. I want to show you that. So, if you come to MUI, you will discover the core library in MUI. You will click here. So, you will get three things. You are also getting the material UI here. I told you that you will work on the material UI. But it has rebranded itself to MUI.com. And a lot of things have been added to it. Like Joi UI. MUI system. So, there are many things in this. And many components have been upgraded and added. So, you will enjoy. We are going to use material UI here. Okay, what is the difference between material UI, UI and MUI system? material UI, component-based library, we will work on it, now you will see how to do it. Components are made and you get to work on it. Components are also made and you get to work on it, but here you don't have any restriction that you have to follow the material design. It follows your material design, Google's material design, which I just told you. But it's not like that. This is your modern, you can say, look, you will get it here. You can also give a custom look here. If you want material design, then you can follow this one, otherwise you can also do this. But the most used is material UI. You will get all the components and it looks very nice to see. So you will also explore this, it is the same way, I am exploring it now. And what is the MUI system here? So MUI system is your root, on which MUI and UI are based. Means you get all the core utilities here. If you want to do some changes, then you can see the properties here. You can customize the components of your material UI. Like you have to put the border, give the sizing, etc. So you use the SX attribute in this way. Here you will add your custom property, utility, etc. And your work will be done. You can also customize it according to you. So we will see all this a little bit here. First, let's come to the material UI. So I am discussing the material UI here. Material UI. Click on get started, you will get the overview here, you can read all these things, if you come down a little, you will get the installation here, you will get the usage, you can also see the installation, usage etc etc. So it is a very nice documentation, if someone reads it once, he will understand it. I will click on installation, it is saying that this is your default installation, so copy it here, so I will come here and my react project is open here, I have already installed VT, I have set it up here, you can do it. And you don't have to set up anything like Tailwind. Okay. Only wheat. Only wheat. Alright. So here. I. Because we are going to use Material UI. So Tailwind or Daisy UI. We won't do it separately. Use the same package. Do it well. So here. We have to install. So we will open the terminal. And here. We will paste it quickly. Is something wrong? Oh man. Another command has been pasted. Wait a minute. Here. control V, so see this, npm install, at the rate, mui material, at the rate, emotion react, at the rate, emotion slash style, you have to install these three here, so let it install, it will be installed here, and till then we will go ahead here and see what we can do, so there are a lot of things, but first of all we go to components and see components, if you come to all components, then you can see what kind of component you can make, you can make auto complete, button group, check box, rating etc. there are many components here, how to display data, you have to make feedback section, you have to design the surface, you have to make navigation, so you have a lot of things here, so you can use anything, so I will show you one by one here, we will clear it and there were many things in the installation, so I will show you once after coming to the installation, otherwise you will get confused and you will think to add peer dependency but you don't have to add because you are using react those who are not using react are being told here that react, react-dom all these things are necessary dependencies are necessary to be available so we are using react so we have this and if you are using react 18 and below then you may have to do something here we are using latest so there will be no problem here after that why is this needed you can read all these things with styled component you can do all this but you don't need it you are using core material UI you can work there here it is telling that material UI uses emotion as its default system engine emotion uses default system engine which I have just told you I am UI system if you want to use styled components instead run one of the following command you can run this command and use styled component but you don't need this You can do all the things properly with it. After that, you can use Roboto Font or different fonts. If you want to use the icons of Material UI, if you get a component like this where the Material UI icon is being used, then you will have to install this too. So I would recommend that installed and this one. Because there will be a need for icons. There will be a component where the icon will be used. So where will you get the icon? So this package will be used for the icon. So you have to install this. So I will do it now. For now, I will show you which components you have. First of all, let's come to the components. You can take any input, auto, complete, button, different things. First of all, let's start with the button. So, see which button you have to take. And see the click effect. It looks so beautiful to click here. So, you can take any. You can see which one you have to take. Suppose I have to take this one. Secondary, success, error. So just below this, you will see the expand code. If you expand the code, then the whole code will come to you. You see so much in the collapse that you have to put so much, but if you expand it, you will see that you have to import it. So expand the code and choose JS instead of TS. We are using JS right now. So we will copy this. You can also copy from here. By copying, I make a new folder here. In this, we will make and use all the components. So first of all, I give its name buttons.jsx. And here we will paste it completely. So see we have pasted it. And that's it, our work is done. Here they have given the name of the component color buttons. So I simply write buttons here. It is not necessary that you give this name and this name the same. This is the fund of react, you know. If you are exporting default, then you can give any name here. But it will be good if you give the same name here and here. So you get suggestions if you give the same name. So we have exported the default buttons and we have copied and pasted the rest. So, after coming to the app, these notes etc. will be clear to you that MUI system, style engine is basically foundation and styling layout. And material UI and UI UI is based on this. Component library is built on top. This is your whole base. If you want to customize, then you will have to go to this system engine and see documentation etc. I will show you all those things now. So, here the component of buttons is our buttons. Suggestion is not getting. Buttons, ok. So, see, our import is also done. Since we have used the same name buttons and buttons so I am getting suggestions too. Alright. So let's see how it is looking. Let's run it too. npm run dev. It will run. And I think in the wrong folder we have to go to the folder with cd read. And then we will do npm run dev. Okay so it will run. And before that we have read a lot of things in react. So you can see this. We have read a lot of things. We have made a lot of projects. So localhost 5173 will open here. So can you see the button? I can't see it. Okay, is there any error? Invalid hook call. Hooks can only be called inside of the body of the function component. Okay, is it like this? Where did we make a mistake? Index.css, first of all, remove this css. We don't need it at all. We are going to use the core material UI. And in min.jsx, strict mode etc. If you don't remove it, then there is no problem. But remove it. Let's see where the error is. Is there an error in the button itself? Let's reload. So maybe you have an error. It is coming in the button itself. They have used some icons here. They haven't done it yet. So there shouldn't be any issue here. The rest of the buttons are fine here. What is the problem? We had installed it. We haven't installed it outside. Oh, actually we have installed it outside. There was a problem. We had to install it inside the folder. Inside the wheat folder. Because we are working inside wheat. I'm so sorry. So, so, so sorry. So, here you delete this node module. It was installed outside by mistake. I check every time. I don't know how the mistake happened this time. So, here we will split the terminal separately. And here we will run that command. Material UI. This one. Okay. So, our Material UI will be installed. And then all the errors that are coming will disappear. Let it be installed. One mistake had happened to us. So, we have just fixed it. and let's close it, it is running, we will come here, we will reload it again, I don't know what the problem is here now that we have installed it properly, you can come and see in the package that you have not installed it, everything is installed, so you do one thing by cutting it again, let's run it again and see here, it is not working, it is working now, it is working now, Why is it looking like this? Because here is a dark theme. The background is white and the component is in dark theme. By default, the component is in dark theme. You can definitely change it in light theme. You will see something like this in light and something like this in dark. For now, this is a slight change, not much. But in many places, you will see more changes. Like if you see in dark, the color of the button is something like this. And if you see in light, the color of the button is something like this. So let's apply this button too, we will know if it is in dark mode or light mode. So we will expand, we will copy from here and come here and paste it in the button. Why? Let's make a separate component. Let's paste this button in the button. This is a small button. And where is our button? This was the button, right? So just below this button, this button has come. Alright. And see what to do with the import. Import button. So our button is already imported, no problem. So you have to use it in this way. See, the button has come to you. And this type of button is coming, that means it is in your dark mode or light mode? It is in light mode. Okay, it is not in dark mode. In dark mode, it looks like this color. Right now, it is looking like this. That means it is in light mode. You can change it in dark mode. How will you do it? I will tell you all that too. You can change the color very easily here. In dark to light, in light to dark. Everything easily. In the next lecture, we will also do the project. So it will be fun. For now, let's explore a bit with documentation. So, this way you can use multiple components here. You need to use this upload file button. So, this upload file is open here. It means logic is also working here. So, you will do expand code here and copy it. And come here. So, come here and make a new component. Upload file.jsx and I have pasted it, we will give its name, where is the component, here is the component, we will give its name, upload files, it is a file, it is only a file, upload file, and come here and put the upload file under the buttons in the app, and it will be imported automatically, you can see, so come here and see how it is looking, so add the rate material, now see here it is telling that the icon is not installed, see here it is using the material icon, collapse it, code. So look here, it is using an icon, it is using a material icon. If you don't have an icon installed, then you will get an error. So here you come in installation. I told you earlier. In get started, come to installation, scroll down a little bit, you will get an icon. You have to feel the documentation, you have to understand it slowly, you will not understand it in one go, slowly, you have to understand it. Look at the code, what kind of problems are coming, I don't understand here, take some chat GPT guidance, do GPT, do Gemini, you will know what the problem is, what the problem is. So, by reading the documentation like this, you can move forward. So, look here, there are a lot of things, how much I will tell you, a whole, like a react playlist, a playlist can be made on it. So, you don't need that much. You will do 2-3 projects, I am telling you in the tutorial, the way you will explore, the way you will explore, it will be fun. So here in installation, I told you to go down a little bit and you will get an icon, material UI icon, copy it from here and quickly split the terminal and see carefully that you are doing it inside the folder of VIT, otherwise if it is installed somewhere outside, it will not work. It will take some time to install. It depends on your internet speed. My internet speed is fine but still it takes some time. Let it be. Let's talk till then. It is very good for you. You can make big and strong projects. I will show you the template that I made. You will be shocked to see how much time it takes to make this much. You will enjoy it. You can take premium templates but they have given good templates for free. You will enjoy it a lot. Your heart will be like a garden. See, it is installed. Let's hide it. Now let's see. Reload it once. See, the error has disappeared. Your upload file looks like this. You can upload here. Assume we have some files. So upload is not written here, you can write it here. So upload file has become your UI, your button is working, it is workable. After that, let's explore some more things, let's come to the components. Suppose you want auto-complete, you understand auto-complete, you will get suggestions etc. Like here is a movie with you, so if you click here, then you are getting multiple suggestions in some way. You can also search here, toy store 3, so here you see toy store 3 has come. So you can work in this way. I will do expand code. So come to JS. Here are two files. One is definitely you will have an array of objects. Where all these things are listed. And here you have this component for UI. So I will copy it from here. And come here in the component folder. I will make a new file. Auto complete. Auto complete. Auto complete field. This is auto complete. autocomplete.jsx and I have pasted it here and I will give its name instead of combo box is it combo box? so you can give combo box also because autocomplete is coming from your material UI so if you import autocomplete then it will import from material UI and will contradict you will get error although you can give auto complete, what is the issue, you can give auto complete, here you see it is written in small, here it is written in capital, so you have to see capital, small, otherwise it will be imported from somewhere else, like I type auto auto complete here, so see I am getting two suggestions, the first one is material UI, so if you take this auto complete from material UI, so you see here, reload, you will get an error, How did you use it? You don't have to use it this way. Okay, I got an error. Where did our autocomplete come from? Our autocomplete came from this file in the component. Okay, autocomplete. And this autocomplete. So, give a little naming convention carefully. Is it okay now? Autocomplete, does the file exist? Obviously, autocomplete exists. Look at this. Close all the other files here. First of all, it's a lot of garbage. remove this, remove this. Okay, autocomplete. And autocomplete is here. So which autocomplete is this that we can't get here? We put autocomplete here. Okay. Okay, in autocomplete you have to give that data too. So where did we take the data file? Here you have the data. So copy it from here. I did copy. Okay. Control C. And here I will give a name. It was films, right? 100 films. So, I give the name films.js and paste it here. So, here export is default. Top 100 films is the name of the variable. So, you come here in autocomplete. See this. This is not. top100films. This will come to you from the films file. This is 100 films. Okay. So, data is also found. Now, it will work properly. Let's reload. Is there any issue still? Upload file is not defined at app. Now what is the problem? What is the problem? Okay, we removed the upload file component. And wait a minute. Upload file. Upload file. Okay. By mistake, we removed the upload file and added autocomplete. So remove this autocomplete which was coming from the material UI. Don't use this. This upload file came. This autocomplete came. So now this must be working. So look carefully how you are giving names. Here autocomplete is coming from the material UI. or the component that you have made here. So the advantage here is that if you have given the name combo box in this case, because auto complete is coming from your material UI. So here you give the name combo box. This also looks better here. So I will give the name combo box. And here instead of auto complete, combo box. Now you will not get the suggestion. We have changed it here. So combo box slash one minute wait combo box Combo box. Now what happened? The folder of combo box has been made. Wait, wait, wait, wait, it's wrong, it's wrong here. What did we do by making a folder? Combo box. This is fine. Combo box. I don't know how the folder was made by mistake here. This combo box is autocomplete, right? So here, this combo box is fine. Change the name of autocomplete and give combo box. Good. And you have this data from here. So combo box. Wait a minute. Remove this from here. And combo box. Now this suggestion will not give. I got a little angry. How many times are you changing? Okay, I got confused. So import combo box from dot slash component slash combo box. And from here you have combo box coming. combobox.jsx and in combobox again it had to be dot slash films ok great alright so here it is working so in this way you can take all the things here just keep in mind some names like where is the import coming from what name you have given how you are using it there are some things you will get to know after seeing the error but if you are a beginner type then it may take some time to understand the error You have to give time. Don't demotivate. Okay. Those who are experienced will get error. They will know immediately. They will fix it immediately. So for that you will need practice. Then you will be experienced definitely. So now let's see further. So in this way button, button group, check boxes etc. You can use different. Let's take something different. Like let's take a slider here. See here. You have a lot of things here. You also have a slider like this. Now what kind of slider is this? This slide is not happening. I don't know if it is fixed or not, they must have done its read only. So you can take this slider, you can take this slider according to you. So you have to put it in the same way, see here, this double range slider, you have a range slider, from where to where you want, from 24 to 42, you can see that, you can take it from here. And if you look carefully, then this state is using something of react. Okay, so you don't have to write logic separately here, it is using react completely here, so you will also get value in this state, which you will set. It's not like you take the component and put the state etc. that you are working with yourself. No. They have made the handle change. They have also made the state. You must be getting the value. Okay. You can console it and see. So copy the code here. Like this. And let's come here and make a new component. RangeSlider.jsx And here you have the range slider. Okay. And here let's import the range slider. Alright, let's see how it is looking. So, see, it is coming in this way. You can see the value here, what is coming in the range slider. By doing CLG, you can definitely see. CLG value. And they have done react.useState. If you want, you can directly remove this and import the useState directly. The normal syntax is ours. React.useState. And useState by destructuring it in this way. You know all this. Normal React things are here. So, see this. You can see the range from 46 to 70. Wow, the value is also getting. It's fun. It's fun. It's fun. It's very easy. It's very easy. Actually, it's very easy. Actually, it's very fun to make all the things with this. When you make the project, you will see how strong the project is, how strong the UI is. There will be a lot of logic implemented in it already. We made it. Like I will make one and show you. Let's try it. You will get templates in getting started. Come to the templates file. You can see the changes in the documentation. You can see the live preview of this template. You can use this template. Where will you get the code? You will get the code here. source code is given here, here you can open it from code sandbox, so from code sandbox you can see this preview very soon, so let's open it from code sandbox, and here we will also see its preview, see this, this code is written here, and there is a lot of code, actually multiple components are made in components, definitely you see how strong UI they have made here, so you will have multiple components, so so many components are made, then there is something, public, theme folder is here, dashboard index, package.json, tsconfig.json, So there are a lot of things here. And I don't know why it's taking so much time. It should have worked by now. It should have been live. But I don't know why it's taking so much time. Let's wait a little. It's almost open. And module not found error. Okay, in this template, it seems there is some problem. There is a mistake. Data grid is not being found here. So we will have to apply data grid by ourselves. If you want to remove the data grid, you can remove it and use it. So let's leave this component for now. You can also give feedback to the community in the material UI that this problem is coming here. Let's try another template. Suppose we have to try this template, then again in the code sandbox, let's see whether it is running or not. Because if there is an error here, then if you use it, you will also get an error. Okay, keep this in mind. If the code sandbox is not able to run, then the one you will run normally, react main basically vs code main, toh wo bhi run nahi, jaise yeh run kar gaya, toh definitely yeh aapke vs code main bhi run kar gaya, isko code aap kaise leenge, so, code dikh raha hai gaya kahin aapko, edit sandbox, code wegera download karne ka option hai kahin, edit sandbox, editor yeh open ho raha hai kya, dekh lete hain, yeh toh bilkul exact vs code ke tarah yeh open ho gaya, wow, So here comes the option of download. I opened the editor, here comes the option of download. We will click on download. So our code will be downloaded. Wow, it has been downloaded. If it doesn't download, then normally you have multiple options. You can also download on GitHub. They have given the source code of GitHub here. So see, GitHub has been opened. And directly if you want to download quickly, then you also have Stackbleach. You will click on the Stackbleach link. So here you will get the option of download directly above, as far as I know. Most of the time, I download it right away. It downloads smoothly. running slow. Here is the download option. If you click on it, it will download. We have downloaded two files. Let's come and see. I have opened the folder here. And look, both are done. So extract any one of them. Your work will be done. And make a new folder here. Give the name of the folder template. Okay. and put this in it and here extract it extract here ok our extract is done and delete it delete and our project is done really yes it is a template basically it is simple you can add multiple things in it add logic and complete the whole project so you got a basic template of starting so open with vs code our vs code is already busy so we can do one thing It's okay, we can open multiple things on the same VS Code, no problem. Although I also have another VS Code. There are many solutions, see I also have VS Code Insider. Anyway, let's open it on VS Code. If we open multiple things, then our VS Code will not break. This laptop is also strong, VS Code is also strong. So you have everything in SRC, component, internal, theme, dashboard, index.tsx. and it is using TSX, if you want to use JSX, then use JSX and if they have used something, like for type safety, they have used TSX, then you can remove all this if you want to use JSX, although it is good if you have used TSX, then there is no problem, why is this error coming, there are a lot of underlines coming here, because we have not installed here yet, because of dependency, so let's install dependency here, You have to simply run the npm i command here. All the dependencies that are needed for this, all those dependencies will be installed here. And you can see this template live. You will enjoy it. Now if you see, you will get a lot of work done. See. Install it quickly. These days, the net is going slow a lot. Otherwise, it would have been installed in such a long time. Anyway, let's wait a little. We are going to get a good look here. So, this much patience is required. Right? We will wait a little. It will install. We will run npm run dev quickly. And we will see a great UI on the screen. So, see this. Installed. Node modules have come here. It is showing some deprecate. Maybe they have not updated. It is their mistake, not ours. So, you can You can make changes. There is a folder named components here. If you want to add something else, you can take it according to you. Or if you have made a new project, you have to use it completely. So you will see the components. Although it will take time. It will not take time. It will be done quickly. To understand the components, which components are being used where. If you want to merge it in your project, then you will have to do it carefully. Which component are you doing? Is it your install or not? etc etc. It is not taking much time. I'll turn it off if I'm out of my mind. No, I'm just kidding. Let it be, it'll be done. It's done, okay. There was a problem with net. We'll run npm run dev, it'll be done. And now your error will be gone. It must have gone. So you can come and see in components if you're getting any error or not. So it's running. Let's open it by clicking on control. And here, this UI is going to come. Wait a little. It's a good UI. It's taking a load here. There's a problem here. What's the problem? SRC theme, customizations, index.ts, does the file exist? Everything is here. What have we done wrong? We took the code as it was. What's the problem then? Wait, wait, wait, wait, wait. Okay, wait. We installed two files. We will install it again. Maybe there is some problem here. Let's come back to our material UI. First of all, close it. I have opened too much. Close this. Close this. And simply this UI was opening on the code sandbox. This was opening on the code sandbox. There was an error here too. There was an error in this one. Oh man, I think we did this one. We had to see this one. There was no error in this one. So this one. Okay, this one is opening. Let's quickly see if this one is opening or not. Yes, I think this one is opening. Okay, we have to use this layout. So this one. Maybe we downloaded this one. This one will go to stackblaze from here. And we will download it quickly from here. And this will run our run. Let's download it quickly. Now you know all this. So who is new, who is old, I don't know. Remove this. Remove everyone. And come here. Here. And here again download it once again. Ok, we have downloaded it. And we had deleted something. Has it been deleted? It has been deleted. Ok. So, let's make a new folder. New folder. And let's put it inside this. We will open it here by right-clicking. Open with VS Code. We will open it quickly. And here cut, cut, cut. Ok, in VS Code. And what has been opened here? I'm so sorry. First, extract it. Extract it. Delete it from here. And now right-click here. Open with VS Code. And now it has been opened properly. Let's zoom in a little bit. And quickly install npm install here. npm i And while it's being installed, instead of passing time this time, let's do something. Let's cut it from here. What should be done? So here, you can explore more components like you need some tooltips so you can take these tooltips and if you need progress bar then you can take progress bar multiple progress bars are available here and as you accept you can see the loading 100% you want to track how much file is uploaded you can use all this it is very interesting actually and you will also have a loading button Many times you get confused in implementing logic that if you click then loading should be seen on the button. So here you will get all that too. As you can see here, I will click on send. So this is not the one. Let's come down a little bit. Here it is. Okay. Loading one. So here you can see that loading is false. As soon as you click on send, see loading is happening. Means it is being sent. As soon as the API will be called, you will get the data or whatever will be sent. So here you will do loading false again and you will see this. So you can go to the show code and see the code. They have made a very good state here. Loading, set loading. And handle click is handled from here. So you can do all the work very easily here. Hmm. Okay. What is our install in VS Code? So install is done. Let's run it with npm run dev. And this time, hopefully, it should run well. And our work should be done here. So see, you have this UI ready. This was our template. We have used it. And it is so long and wide. Very cute. Okay. It is made. And it is looking so cute. Look at this. And completely responsive. Completely responsive. Look at this. Wow. Wow. Awesome. Okay. It is so responsive here. You can implement different pages on button click. So, it is fun. Right? This whole template is ready for you. Okay. And here. Okay. They have implemented the theme too. Light mode, dark mode. Wow, it's fun. It's fun. System theme will be implemented here. It's fun. It's fun. Okay, let's implement the theme ourselves and see how it can be implemented. So, you got to know about the template. You are getting multiple templates here. You can see all this too. You have to copy and paste the component in a simple way. Now, let's talk a little about the theme. So, in Get Started, you will have the theme. Not in Get Started, you will have it in Customizations. you can see the customizations, I will zoom in a little, you will come to the default theme viewer, so here you can see what changes you have in the dark theme, what changes in the light theme, so this color palette will only change here, the object with the palette will only change in this, so there is light here in the dark theme, simply you just have to make it dark, make it light in the light, make it dark in the dark, and if any changes are happening, then you can see if any changes are happening, so The color is changing a little in light and dark, which I told you that the color of the button can change a little. This is the palette where you have the entire color, primary color, secondary color. You can change it according to you. There are a lot of things here. So how will you set it up? For this, how to implement is given somewhere here. Customizing the theme. Here you can also see customizing the theme. So come here and they have told you how to customize the theme according to you. So, you don't have to do much. You have to create a theme using create theme. Okay. And just in your application. How to use it, they haven't told you. They must have told you somewhere. You will have to see. You have to use theme provider like this and provide it. And that's it. Your work will be done. So, you have to work like this. Here. the create theme in this way. And here you have to make a theme in this way. And you have to make a theme and provide it to you. Okay. That's all you have to do. Come a little higher. Provide is also done somewhere here. So. All this is fine. All this is also good. We are understanding all this. You have to provide a theme provider by creating a theme. We have not done the expand code, so it is half-way. If you do expand code, then you can see the whole thing here. How to do what. So you can see this. So nothing much. Here you have to create a theme by using create theme. In SRC, come to app.jsx. Now this was our template. Where did our main code go? Here it is. We were working on it. So in app.jsx, it is clear till now, it is not confused, we were working by making a different file of that template. This is our one that we are working on now. So here button upload combo. So now we change the theme here. Like ours is in the light theme now. It is in the light theme. It is not even running. Localhost 5173. It is in the light theme. So now we have to do it in the dark theme. We have to change the dark light according to ourselves. So you have to customize the theme. So you are here. and import it here, like this, create theme, theme provider, which I got from the documentation, create theme, theme provider, I have expanded the code, then to create the theme, you have to create the theme like this, like this, your theme is created, you don't have much, it is an object, multiple key values are paired in the object, I just told you, let me show you once again, and you have to wrap it here with the theme provider, whatever component you want the theme, so I want the main measure in the whole application, If I want to implement it, then I will use the theme provider here and wrap it. I used the theme provider and wrapped it. And this is our whole wrap. And in the theme, we use this outer theme or just call it a theme. So now you come here and see how it is looking. There is no error here. We have used the theme provider. We have added the theme here. This orange color is also being imported from the material UI. Green, orange, this color is also being imported from the material UI. So we don't need color from the material UI. So we will do one thing, we will remove this and simply give color according to us. Let's go back to the default theme viewer. This is the whole object and it has multiple key values. In the palette, if I want the mode to be dark, then I will just put the mode here. I don't want to change the color of the primary. I just show the mode. It is light, so I make it dark. So the dark mode is implemented. See, the color has changed. Can you see? It is visible, right? and here I will do light, then this light will come. So the color of the component is changing, but the background is not changing, so definitely component-based library, so whatever components you will use, the theme will be applied to it. If you want to do it in the background, then you get one thing here, which is CSS baseline. This CSS baseline also comes to you from the material UI. So you will simply import it. CSS baseline. See this is CSS baseline. You will import it and put it in your application. Reload it in the top or bottom. This is the light theme. If you make it dark, it will be completely dark. It will handle the background and everything by itself. Dark mode is implemented. You can do more work. Let me show you with a navbar. I am also working by reading the documentation. I don't like to write. You are getting a navbar here. Now I'm getting a slider. Text will toggle material. Now search for the bar. Now the bar is not here. There is something else here. There is no header. Sticky header. Wait a minute. I saw it somewhere here. Radio button rating. All these things. Slider. Switch. Text will toggle. Data display. Badge. Divider icon. Material icon. Table. Tooltip. Typography. Feedback. Alert. Dialogues. and this is accordion appbar sorry not appbar appbar is given here so you can put any appbar here this is appbar so which one should be put here so let's put this one this one looks a bit complex let's put this one so we will code so here you will copy the whole code from here and paste it and this appbar will be applied and if you have installed react icons then only this icon will be working Let's make the component of the navbar. It is very easy. I have made navbar.jsx and pasted it. That's it. And I will change the name after coming up. This is the name of the component. So I will give its name navbar. And our navbar is ready. I will put the navbar here. I did not get the suggestion. No problem. I will import it myself. import navbar from dot slash components slash navbar ok and come here reload see here navbar is applied you can see here navbar ok this search and this icon etc and this is completely responsive my brother completely responsive you can see this see this ok completely responsive all things are coming here and You can do typography and other things. You can also do custom work. I told you about the core engine of the material UI. Click on the home page and come to the discover core library. Here you will find the core engine and utilities. You can also customize according to you. You can see how to use it in the component. So it will tell you to import the box and here you have to use the component and SX style in this way. How? So come here in the style utility, you can see. According to you, whatever you have to customize, like border, you have to give this display, you have to use flex box. And let's say you have to give sizing. I will show you by looking at the sizing simple. You can easily give here. You have to give width of 1 by 4, 300. So you have to use SX attribute. Okay. SX attribute. This is the navbar. not here, but in the material UI components, like I come to the buttons, then I give the sx attribute of any one button here and make the width 500, so you come here and see its width is 500, so according to this you can also customize your things, ok, media query etc., you can work on everything here, all things, so I will tell you everything through project, So you have explored so much, this is more than enough. You can explore more, even you can explore sitting all day long. As much as I have helped you, in the same way you have to explore other things. If you don't understand, you can take the help of GPT. You can ask him if I want to change it like this. Like I will not understand how to implement dark theme. So you can take the help of GPT, he will tell you that you have to go here in documentation in this way. This will be given here. You will put dark in the key value pair. Your work will be done. In this way, you have to put a theme provider. If you want to light with dark, then you will simply light it here. Okay. For dark light theme, shall we put a button and see? Let's put a button and see. What will be the name of that button? Switch. Okay. Switch should be named, I think. Switch. So let's search for switch. Switch. So here you will get a lot of switches. See, there are multiple switches. So this one looks cool to see. This one is cool for light and dark. Okay, so let's take this. Show code. We will copy it here in the show code. And let's make a new file in the component. Theme switch dot JSX. And we will paste it here. So remove this style from here. Remove the style from here as well. Okay. And what did I do? ISO switch. Do you want ISO switch? This is the material UI switch and we don't need the Android 12 switch. You can remove this from here. And here is the form control form control. We have deleted the iOS one, so you can remove this too. Otherwise, you will get an error. We have also deleted the end switch from here. So you can remove this one too. Otherwise, you will get an error. And we don't have an Android 12, so remove this too. Otherwise, you will get an error. Okay, so this is ours. and from here all these typography etc. we have not used remove it from stack ok so now let's apply here may be some error may come so here switch ok and where is this switch coming from material ui again we did not need material ui so now what we have imported component slash switch name was given theme switch okay, theme switch was, so sorry, theme switch was, so here, theme switch, and here also theme switch, oh, wrong place, this theme switch, and come here, let's see, whether it is working or not, reload, see, it is working properly, so let's do one thing, let's make a variable here, let's make a state, const theme comma set theme, and by default here, By default, we use the useState and keep it as light. Okay. And this setTheme. Okay, now there will be confusion in this theme. Let's write mode, mode, set, setMode. Okay. Mode, setMode. So our mode is by default light. And we will pass setMode here in the themeSwitch as a prop. Okay. Now we will not go to set up the state for a small thing. So here is our themeSwitch. name it as a prop we will take set mode and here as soon as it ticks we will set the set mode to true we will set it to set mode definitely light or dark in switch only true or false can come so let's take true or false no issue so here light light mode and set set light mode wait set light mode by default mode will be false or you can keep true light mode and here we will put condition that if light mode is true then it will be light theme otherwise it will be dark theme ok and here we have passed set mode set mode or we have changed it set light mode ok set light mode and here we will take the set light mode and whenever we click on it then the default check is like this and here on click on click on set light mode not of light mode or use functional update not of previous like this so wrong place we put onclick side remove from here this is your component let's format it and it is properly arranged ok form control is complete and Form control label. We had to put it all on this. Or we had to put it on this. On click. See this on click suggestion is also available here. Okay. This is default checked. We had to put it on this. And this is on click. So see a little carefully that you are putting it in the right place or not. And let's see here if it is working or not. Okay. So it is working properly. Light mode. Dark mode. Light mode. Dark mode. Light mode. Dark mode. Okay. And here instead of default checked. You can also give checked here. If your light mode is true here, then now we have not brought it here. So here you can also take light mode as a prop. Light mode and set light mode, we took both and came here and came here in this way light mode set light mode. So in checked, we will pass this light mode variable. So now it has become a controlled component. Okay, the light mode variable is true here, so this button will remain ticked by default here. Let's reload. So, is this dark mode? Light is like this, dark is like this. Yes, this is dark mode. This is the symbol of dark mode. So, in the symbol of dark mode, it comes in this way. So, do the opposite here. Do not of light mode. Not of light mode is there. So, this is like this. Okay. And light mode will be true. So, this will happen. No, this has not happened yet. Light mode you have. By default, what is your state here? Wait. Here. Now it is not working. Let's put light mode here. Light mode whose value is true. So it will come. So in true it is actually dark mode. And in false it is actually light mode. In true it is dark mode and in false it is light mode. So by reversing this checked one will switch here like this. So we can do one thing here. Here here. set it as dark mode set dark mode set dark mode and here set dark mode and here dark mode ok dark mode and here also change the logic according to you in dark mode you will get dark otherwise you will get light because by default when switch is open you can see light mode sorry dark mode so here dark mode quickly copy paste dark mode and here light mode you can write more logic here but I got it like this so I did it like this So here I will put the dark mode. Dark mode. Okay. And here set dark mode. Will come here. Here. And by default our dark mode is true. Okay. So now see. Now it will work properly. Dark mode is true. This is light mode. This is dark mode. Light mode. Dark mode. Light mode. Dark mode. And how properly it is changing here. You can change more things. Like here in light mode this color is. So this is your set primary color. Now as I showed you here. You can come inside the customizations. This is your customization. Default theme viewer is inside the customization. You had the color palette here. In the color palette, you have this. In the primary color, main, light, dark. It is like this. Main, light, dark, contrast test. So suppose I want to change the main color. So what will I do here? Inside the palette. Inside the palette, this is the palette object. Inside the palette object, there is a primary object. Primary. This is also an object. And inside this, you have main. So let's say I want to change the main color here. I don't want to keep this color. Main will come here as a string. Okay, pay attention to this. I don't want to keep this color. So the color is not suggesting me here. The color should have been visible in this way. So let's format it. It's not doing it. It used to do it every time. I don't know why it's not doing it now. So put a comma here. The palette has been turned and the primary color is coming to you in this way. Okay, wait a minute, wait a minute, wait a minute. Oh, okay, we wrote it right. Now it's not coming, it's not coming, what can we do? So your primary color is still here. This is the color. you want to change it and give some other color, for example, you want to give red in the primary. So I will pick the color here and I pick this red color. Okay, it has been picked. So I want to give this color here in the main. So now see, everything has become red. And in dark mode, it looks like this. In light mode, you see this in the main color. According to that, you can change more things here. You can customize the whole theme here. So, you have more things. Secondary color is like this. You have error. For error, this color. For warning, this color. For info, this color. For success, this color. And in gray, you have this color. So, in gray, you can change it. If you want to give something more to 800. Or if you want to do something according to you. So, you can do it. So, in dark mode, it will work according to that. Okay. And if you want to change it in text, you can do it. So, according to you, you can customize the whole theme here. In color, you can do shading. Light mode, dark mode, mode on mode. It will be fun. So, in the same way, you have to use all the components. Multiple components, layouts, you have to explore more things. You will explore more things here. And for now, our work is doing. In the same way, we work here. We write logic. And this is your proper documentation. You can explore more things here. In the same way, you can explore the UI if you want. So you have to simply come to the UI. Here you have to install the UI. Here also it uses Emotion and Emotion Style. And here you will get the made-up components. So you can see some of its components how they look. So its components look something like this. And here if you simply copy it, your work will be done. See here. Here the components look something like this. So it gives a little different look from the material. Okay. A little look like this is coming here. So you can see that you have to use Joi. Both have similar documentation. You have to use it in a similar way. Just keep an error in mind. What is the error coming? Did you make a mistake in importing? The component you made, you had to do it from there. By mistake, the material was imported. Or something happens. No, whenever you explore the library, whether it is for UI or for logic. for different validation, you are using a library, then there you have problems, difficulties, in the first time, because you are exploring that thing, like I did now, then I also made a lot of mistakes, but I understood immediately after seeing it, you may not have time, then you do not have to motivate, after that we will make a project using the material UI, we will make a good project and then we will have fun, I did not show you one thing here, here I said that you get premium themes and templates, etc., so I will show you that quickly, come to the home page and here in the material UI, in material UI, you will come to templates, so see this, you have this type of template, you have multiple templates, see this login screen, you can see this way, you can make all this, you are getting it made, so there are multiple templates, now there are not so many, if you go to the premium template section, then you will get more templates, okay, but this is paid, so this is $ 69, this is $ 69, you will also get something free here, These are all premium templates. You will also get some free premium templates. I saw something free. I don't know if it is available now or not. So all of them are here. See this one. This one is free. So you can use this. You will go to live preview. Here is a download option coming. You can download the code and use this one. So you will sign in. After signing in, see you have here. This whole thing is coming like this. Other pages are here. Okay, other pages are also made. Wow. So you can use this whole template. You will enjoy it. This is also a good template. So, in a way, your application is already made. Everything is working here. Interesting. Interesting. I liked this template. Everything is working here. So, your work will be done in one go. It will be fun. And this is absolutely free. This is absolutely free. And quality checked by MUI team. MUI team is doing a great job. They are managing all these things properly. They have given a lot of things for free. This is It looks even better. Okay. So, here you are getting this theme. You can check out more themes here. Oh man, how did this move? Come here for a minute. So, you have more themes available here. Where did the other theme go? So, let's back, back, back. Back, back and back. We have backed so much, but still here. Okay, it was here. So you will get more free themes here. This one is also free. You can check out this one by doing a live preview. You can do a lot of work on this too. How did the direct code open? We did a live preview. So its direct code is opening. Live preview is not happening. I don't know why. Okay, I have to click on it. So I clicked on it here. So the live preview option is coming. But again, I don't know here. They have given the wrong link. So you can download it and see your direct VSCode. So this one is also free. This is also a live preview. It is open, this is a live preview. So it is also very good here. Login page etc. are made here. So this is also nice. You can also try this. And you also have this one is free. This one is also free. Even this one is also free. You can also see its live preview. If the live preview is available here. So, its live preview is also available. It will look something like this. And above this, this is the header of MI. It is the header of MUI. So, you have to ignore this, this header. What has clicked by mistake? Okay, see this header has moved here. So, you will see something like this, the site is made. And all this, they have put a link here. So, login page is redirecting to a different place here. So, these pages are made here. There is a lot here. In the dashboard, you can see something like this dashboard. So you can see here according to your template, you can make a good UI by removing some of the components inside. So you also have this one free, which is also a live preview, you can see it once. Okay, so look at this, it looks something like this and there is also an animation attached. Wow, wow, wow, I liked this one too. It also has all the things made. Nice. It's good, it's good, this one is also good, okay. Actually, it's very good. A lot of things are made here. Are there any pages? This is the block page. This is the dashboard page. It's redirecting to a different place. So it's good that you can explore all these things. And I'm closing it again and again. It was here. So you can see more themes here. This is also free. This is also free. Now that you are getting so much free, what else do you need? Even the paid one is also very good. And it's not like he's taking a monthly charge. Once you pay, done. Then you can use it easily. You just have to pay once. Okay. So back here. So let's see the paid one once. This one is the paid theme. Will we get a live preview here? We are getting a live preview here. So I can't find it actually. I can't find the live preview. Okay, we have to buy here. Then maybe live preview. Let's see some other paid theme here. Like this one is paid. Are we getting its live preview? Let's see the live preview. So yes, we are getting its live preview. Okay. So look at this. It looks like this. Wow. Okay, okay, okay, okay. So this way, it was much better for free. That one. Ok, this is looking simple to me, it doesn't look like much. This is simple. Ok, this is also good. So you can see that you are getting a lot of good templates for free. You will enjoy it. You can work, you can make applications according to you. And you can make a lot of hard ones once your hand sits on it. Ok, I have also told you how you can work with Desi UI, but it is for such big applications. Although you can mix tailwind and do it in big applications. So that's all for material UI for now. I have made you explore a lot. I have made you explore more than what should not be done. Now you have to practice a little more. And then in the next lecture we will make a project on material UI. So it will be fun. Okay. So that's all for now. Then we will meet in the next project. Till then you have to explore and make a project by yourself. And bye bye.
