Material UI Introduction and Installation for React

Material UI is the most powerful and efficient tool to build an Application by adding Designs and Animations and use it with technical and scientific innovation. It is basically a design language that was developed by Google in 2014. It uses more Design and Animations, grid-system and provides shadows and lightning effects.

It can be used with all the JavaScript frameworks like AngularJS, ReactJS, VueJS etc. to make the Application more amazing and responsive. With over 35,000 stars on the GitHub, Material UI is one of the top User Interface libraries for React.

Features of Material UI: Material UI provides low-level utility functions called “style functions”  for building powerful design systems. 

  • Access the theme values directly from the component props.
  • Encourage UI consistency.
  • Write responsive style effortlessly.
  • Work with any theme object.
  • Less than KB g zipped.
  • Fast enough to execute.

Prerequisite:

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



  • Install Material UI by using npm
npm install @material-ui/core
  • Install Material UI by using yarn
yarn add @material-ui/core

Example: In this example we will make changes in App.js, we will import Material UI and place a button with the primary color.

HTML

filter_none

edit
close

play_arrow

link
brightness_4
code

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

chevron_right


Output:

react-js-img

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

1


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.