React Material-UI Introduction and Installation
Material UI is the most powerful and efficient React UI Framework to build an Application by adding Designs and Animations and using 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.
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:
- A code editor like (VS Code, Atom, Sublime etc).
- NodeJS should be installed.
Installation of Node.js on Windows
Installation of Node.js on linux - Knowledge of creating a react app.
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.
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">
w3wiki
</Button>
</div>
);
}
}
export default App;
Output:
Contact Us