react ui code example

Example 1: material ui react

// Get the core
npm install @material-ui/core

// Those fancy SVG icons
npm install @material-ui/icons

// Roboto is the font Material-UI is based around, ofc you can omit this
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />

// Font Icons
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />

Example 2: react material ui

npm install @material-ui/core

Example 3: react js material ui

//install in the terminal
$ npm install @material-ui/core

// use the CDN 
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />

//on the component
import { Button } from '@material-ui/core';

function App() {
  return <Button color="primary">Hello World</Button>;
}

Example 4: material ui

$ npm install @material-ui/core

Example 5: react.js

class ShoppingList extends React.Component {
  render() {
    return (
      <div className="shopping-list">
        <h1>Shopping List for {this.props.name}</h1>
        <ul>
          <li>Instagram</li>
          <li>WhatsApp</li>
          <li>Oculus</li>
        </ul>
      </div>
    );
  }
}

// Example usage: <ShoppingList name="Mark" />

Example 6: react documentation

class Board extends React.Component {
  renderSquare(i) {
    return <Square value={i} />;  }
}

Tags:

Misc Example