-
-
Save iamrameshkumar/9abdce94dc4c6b78fb7030d39046ebcf to your computer and use it in GitHub Desktop.
Material UI React Login Form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Paper, withStyles, Grid, TextField, Button, FormControlLabel, Checkbox } from '@material-ui/core'; | |
import { Face, Fingerprint } from '@material-ui/icons' | |
const styles = theme => ({ | |
margin: { | |
margin: theme.spacing.unit * 2, | |
}, | |
padding: { | |
padding: theme.spacing.unit | |
} | |
}); | |
class LoginTab extends React.Component { | |
render() { | |
const { classes } = this.props; | |
return ( | |
<Paper className={classes.padding}> | |
<div className={classes.margin}> | |
<Grid container spacing={8} alignItems="flex-end"> | |
<Grid item> | |
<Face /> | |
</Grid> | |
<Grid item md={true} sm={true} xs={true}> | |
<TextField id="username" label="Username" type="email" fullWidth autoFocus required /> | |
</Grid> | |
</Grid> | |
<Grid container spacing={8} alignItems="flex-end"> | |
<Grid item> | |
<Fingerprint /> | |
</Grid> | |
<Grid item md={true} sm={true} xs={true}> | |
<TextField id="username" label="Password" type="password" fullWidth required /> | |
</Grid> | |
</Grid> | |
<Grid container alignItems="center" justify="space-between"> | |
<Grid item> | |
<FormControlLabel control={ | |
<Checkbox | |
color="primary" | |
/> | |
} label="Remember me" /> | |
</Grid> | |
<Grid item> | |
<Button disableFocusRipple disableRipple style={{ textTransform: "none" }} variant="text" color="primary">Forgot password ?</Button> | |
</Grid> | |
</Grid> | |
<Grid container justify="center" style={{ marginTop: '10px' }}> | |
<Button variant="outlined" color="primary" style={{ textTransform: "none" }}>Login</Button> | |
</Grid> | |
</div> | |
</Paper> | |
); | |
} | |
} | |
export default withStyles(styles)(LoginTab); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment