0.0.4 • Published 6 years ago

cl-icon v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

基于 Material DesignReact 图标库

数据来自开源项目 https://github.com/Templarian/MaterialDesign,共包含 2549 个图标,足以满足日常开发中绝大部分的使用场景。

图标速查参考官网: https://materialdesignicons.com/

v0.0.3 更新

  • 一个图标对应一个React组件,按需引用,不会再增加js文件体积了
  • 保持简单,移除对Vue组件的支持,现在只支持React

部分预览

image

安装

yarn add cl-icon

npm i cl-icon

使用

形如 import [自定义组件名] from 'cl-icon/dist/[图标名]' 的引入方式,其中 图标名 请通过官网 https://materialdesignicons.com/ 自查

例子:

// 在本例中:
// AlertIcon 代表 [自定义组件名]
// alert 代表 [图标名],

// 导入
import AlertIcon from 'cl-icon/dist/alert';

// 使用
<AlertIcon size="24" color="#666" />

属性说明

属性
color?可选;字符串;
size?可选;字符串或数字;
style?可选;样式
className?可选;类名
  • color: 表示图标颜色,合法的CSS颜色值,如#333red, rgba(0,0,0,.5)
  • size: 表示图标大小,为数字时默认单位是像素,也可以是css单位,如24px0.24rem
0.0.4

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago