diff --git a/docs/src/pages/demos/buttons/IconLabelButtons.js b/docs/src/pages/demos/buttons/IconLabelButtons.js new file mode 100644 index 00000000000000..760dd0db9691e1 --- /dev/null +++ b/docs/src/pages/demos/buttons/IconLabelButtons.js @@ -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 ( +
+
+ + + +
+
+ + + +
+
+ ); +} + +IconLabelButtons.propTypes = { + classes: PropTypes.object.isRequired, +}; + +export default withStyles(styles)(IconLabelButtons); diff --git a/docs/src/pages/demos/buttons/buttons.md b/docs/src/pages/demos/buttons/buttons.md index 3554407e56d6fa..b88c1201e868cc 100644 --- a/docs/src/pages/demos/buttons/buttons.md +++ b/docs/src/pages/demos/buttons/buttons.md @@ -43,6 +43,11 @@ Icons are also appropriate for toggle buttons that allow a single choice to be s {{demo='pages/demos/buttons/IconButtons.js'}} +### Buttons with icons and label +Sometimes you might want to have icons for certain button to enhance the UX of the application as humans recognize logos more than plain text. For example, if you have a delete button you can label it with a dustbin icon. + +{{demo='pages/demos/buttons/IconLabelButtons.js'}} + ## Complex Buttons The Flat Buttons, Raised Buttons, Floating Action Buttons and Icon Buttons are built on top of the same component: the `ButtonBase`. diff --git a/pages/demos/buttons.js b/pages/demos/buttons.js index 18d042d816f884..f82a552405ee62 100644 --- a/pages/demos/buttons.js +++ b/pages/demos/buttons.js @@ -36,6 +36,13 @@ module.exports = require('fs') raw: preval` module.exports = require('fs') .readFileSync(require.resolve('docs/src/pages/demos/buttons/IconButtons'), 'utf8') +`, + }, + 'pages/demos/buttons/IconLabelButtons.js': { + js: require('docs/src/pages/demos/buttons/IconLabelButtons').default, + raw: preval` +module.exports = require('fs') + .readFileSync(require.resolve('docs/src/pages/demos/buttons/IconLabelButtons'), 'utf8') `, }, 'pages/demos/buttons/ButtonBases.js': {