forked from mui/material-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docs] Add demo for buttons with label and icon (mui#8922)
* Added demo for buttons with label and icon * Fix ESLint issue * Fix some ESLint error : - missing flow annotation - no-unused-var
- Loading branch information
1 parent
b1554c9
commit 906c2ba
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// @flow weak | ||
|
||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import Button from 'material-ui/Button'; | ||
import { withStyles } from 'material-ui/styles'; | ||
import Delete from 'material-ui-icons/Delete'; | ||
import Done from 'material-ui-icons/Done'; | ||
import FileUpload from 'material-ui-icons/FileUpload'; | ||
import KeyboardVoice from 'material-ui-icons/KeyboardVoice'; | ||
import Save from 'material-ui-icons/Save'; | ||
import Send from 'material-ui-icons/Send'; | ||
|
||
const styles = theme => ({ | ||
button: { | ||
margin: theme.spacing.unit, | ||
}, | ||
leftIcon: { | ||
marginRight: theme.spacing.unit, | ||
}, | ||
rightIcon: { | ||
marginLeft: theme.spacing.unit, | ||
}, | ||
}); | ||
|
||
function IconLabelButtons(props) { | ||
const { classes } = props; | ||
return ( | ||
<div> | ||
<div> | ||
<Button className={classes.button} raised color="accent"> | ||
Delete | ||
<Delete className={props.classes.rightIcon} /> | ||
</Button> | ||
<Button className={classes.button} raised color="primary"> | ||
Send | ||
<Send className={props.classes.rightIcon} /> | ||
</Button> | ||
<Button className={classes.button} raised color="default"> | ||
Upload | ||
<FileUpload className={props.classes.rightIcon} /> | ||
</Button> | ||
</div> | ||
<div> | ||
<Button className={classes.button} raised color="contrast"> | ||
<Done className={props.classes.leftIcon} /> | ||
Done | ||
</Button> | ||
<Button className={classes.button} raised disabled color="accent"> | ||
<KeyboardVoice className={props.classes.leftIcon} /> | ||
Talk | ||
</Button> | ||
<Button className={classes.button} raised dense> | ||
<Save className={props.classes.leftIcon} /> | ||
Save | ||
</Button> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
IconLabelButtons.propTypes = { | ||
classes: PropTypes.object.isRequired, | ||
}; | ||
|
||
export default withStyles(styles)(IconLabelButtons); |
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
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