The Wayback Machine - https://web.archive.org/web/20230504185211/https://www.geeksforgeeks.org/react-material-ui/
Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

React Material UI

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

React Material UI is a framework built upon React library which contains predefined components to create React applications. Material UI is basically a design language built by Google in 2014 and works with various JavaScript frameworks apart from React such as Angular.js and Vue.js. The quality of the inbuilt designs of Material UI and its easy implementation makes it the first choice of most developers. The inbuilt components are also customizable so it helps easily recreate the designs.

React-Material-UI
 

Material UI has more than 2500 contributors which are actively contributing to creating customized UI components and providing the latest features for developing web applications. Since the introduction of Material UI the development of React applications has become a lot faster. The latest version of Material UI is version 5.0.0 which was released in September 2021. One of the various advantages of Material UI is that it has a depreciation policy which allows easy upgrades to old deprecated components.

Features of React Material UI:

  • Highly customizable: The templates provided are easily customizable and require very less coding to make changes to existing templates
  • Responsive: The inbuilt components are by default responsive so it is easy to create web applications for different screen widths.
  • Fast loading: Loading of the components is faster as compared to other frameworks
  • Themes: Vast variety of themes and easy customization is possible.
  • Backend friendly: It is easily integrable with the backend.
  • Depreciation policy: Material UI provides easy upgrades for old deprecated methods.

Environment Setup: The first step in learning Material UI is setting up the environment.

Step 1: First, create a react project using the following command in the terminal.

npx create-react-app new

Project structure after running the above command:

React project structure

React project structure

 Step 2: To install Material UI run the below command in your working directory.

npm install @material-ui/core
        OR
yarn add @material-ui/core

After running the above command the dependencies in package.json will update and look like this.

MUI in dependencies

MUI in dependencies

Example: In this example, we will create a basic React MUI button and steps to run the program. The changes will be made in the App.js file

Javascript




import React, {Component} from 'react';
import './App.css';
import Button from '@material-ui/core/Button'
  
function App() {
    return (
        <div className="App">
            <Button variant="contained" 
                    color="secondary"
                    size="large">
                GeeksforGeeks
            </Button>
        </div>
    );
}
  
export default App;

Run the code: To run the above code type the following command in the terminal.

npm start

Output:

MUI button

MUI Button

Learn more about React Material UI:

Alternatives to Material UI: The two main alternatives for React Material UI are ReactJS Blueprint and React Bootstrap

Recent articles on React Material UI

Please write comments if you find anything incorrect, or if you want to share more information about the topic discussed above.


My Personal Notes arrow_drop_up
Last Updated : 15 Mar, 2023
Like Article
Save Article
Similar Reads
Related Tutorials