ant-design/components/icon/demo/two-tone.md
2018-09-02 20:59:37 +08:00

736 B

order title
1
zh-CN en-US
多色图标 Two-tone icon and colorful icon

zh-CN

可以通过设置 theme 属性为 two-tone 来渲染双色图标,并且可以设置全局性的主题色。

en-US

Specific them property theme to two-tone to render two-tone icons. You can also set the primary color globally.

import { Icon } from 'antd';

Icon.setTwoTonePrimaryColor('#1890ff');

ReactDOM.render(
  <div className="icons-list">
    <Icon type="dollar" theme="two-tone" />
    <Icon type="euro" theme="two-tone" />
    <Icon type="check-circle" theme="two-tone" primaryColor="#f5222d" />
  </div>,
  mountNode
);
.icons-list > .anticon {
  margin-right: 6px;
  font-size: 16px;
}