Advertisement
ZeroSeventty

React Card with material ui

Jun 3rd, 2021
959
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react';
  2. import { makeStyles } from '@material-ui/core/styles';
  3. import Card from '@material-ui/core/Card';
  4. import CardActions from '@material-ui/core/CardActions';
  5. import CardContent from '@material-ui/core/CardContent';
  6. import Button from '@material-ui/core/Button';
  7. import Typography from '@material-ui/core/Typography';
  8.  
  9. const useStyles = makeStyles({
  10.   root: {
  11.     minWidth: 275,
  12.   },
  13.   title: {
  14.     fontSize: 14,
  15.   },
  16.   pos: {
  17.     marginBottom: 12,
  18.   },
  19. });
  20.  
  21. export default function SimpleCard() { //It will have a custom name
  22.   const classes = useStyles();
  23.  
  24.   return (
  25.     <Card className={classes.root}>
  26.       <CardContent>
  27.         <Typography className={classes.title} color="textSecondary" gutterBottom>
  28.          {/* It will have a text typed with the vscode cursor */}
  29.           Hello Dev
  30.         </Typography>
  31.         <Typography className={classes.pos} color="textSecondary">
  32.             {/* It will have a text typed with the vscode cursor */}
  33.           Welcome to
  34.         </Typography>
  35.         <Typography variant="body2" component="p">
  36.             {/* It will have a text typed with the vscode cursor */}
  37.           SoftDevs
  38.         </Typography>
  39.       </CardContent>
  40.       <CardActions>
  41.         <Button size="small">{/* It will have a text typed with the vscode cursor */} Come to code with us</Button>
  42.       </CardActions>
  43.     </Card>
  44.   );
  45. }
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement