[英]How to change the design of the IconButton in material-ui?
Material-ui has provided us with a default icon button. Material-ui为我们提供了一个默认的图标按钮。 However, I would like to change the design of the default icon button to be like this : IconButton design needed
但是,我想将默认图标按钮的设计更改为如下所示: 需要IconButton设计
May I know how do I change it? 我可以知道如何更改吗? Thank you.
谢谢。
As per these docs (see them for detailed instructions), IconButton
will work with any of the icons found here . 根据这些文档 (有关详细说明,请参阅它们),
IconButton
将可与此处找到的任何图标一起使用。 The image you have linked looks most like menu
. 您链接的图像最像
menu
。 Example of usage: 用法示例:
import React, {Component} from 'react'; import IconButton from '@material-ui/core/IconButton'; import Menu from '@material-ui/icons/Menu'; class App extends Component { render() { return ( <IconButton> <Menu/> </IconButton> ); } } export default App;
If you're using create-react-app
and want to use a custom SVG, do this: 如果您使用的是
create-react-app
并想使用自定义的SVG,请执行以下操作:
import React, {Component} from 'react'; import IconButton from '@material-ui/core/IconButton'; import CustomMenu from './custom_menu.svg'; // root of src class App extends Component { render() { return ( <IconButton> <img src={CustomMenu}/> </IconButton> ); } } export default App;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.