# cefc-ui-icon

> CEFC-UI-ICON

Latest version **0.0.36** (published 2018-01-31) · ISC license · 0 weekly downloads

## Install

```sh
npm install cefc-ui-icon
pnpm add cefc-ui-icon
yarn add cefc-ui-icon
bun add cefc-ui-icon
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.36 |
| Published | 2018-01-31 |
| First published | 2017-11-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Carlton |
| Maintainers | carltonxiang, wscops, chenghuijun, simon_zhx, kane |

## Links

- npm: https://www.npmjs.com/package/cefc-ui-icon
- npm.io page: https://npm.io/package/cefc-ui-icon

## Dependencies (2)

- [classnames](https://npm.io/package/classnames.md) ~2.2.5
- [cefc-ui-style](https://npm.io/package/cefc-ui-style.md) ~0.0.10

## Recent versions

- 0.0.36 (latest) — 2018-01-31
- 0.0.35 — 2018-01-31
- 0.0.34 — 2018-01-29
- 0.0.33 — 2018-01-26
- 0.0.32 — 2018-01-26
- 0.0.31 — 2018-01-26
- 0.0.30 — 2018-01-26
- 0.0.29 — 2018-01-26
- 0.0.28 — 2018-01-25
- 0.0.27 — 2018-01-22
- 0.0.26 — 2018-01-22
- 0.0.25 — 2018-01-22
- 0.0.24 — 2018-01-16
- 0.0.22 — 2018-01-15
- 0.0.21 — 2018-01-15
- … 20 more at https://npm.io/package/cefc-ui-icon/versions

## README

## Icon

我们使用了阿里巴巴矢量图标库:

- 从 http://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=501801 中查找需要用的图标，如icon-add,如果没有找到，则从矢量图标库中选择想要的，然后添加到项目中。

- 如果改动了图标（添加或删除），在上述链接中中找到我的项目，将Font class下所对应的新的链接替换到Icon项目src/style/index.less文件中。

## 命名

我们为每个图标赋予了语义化的命名，命名规则如下:

- 实心和描线图标保持同名，用 `-s` 来区分，比如 `question-circle`(描线) 和 `question-circle-s`(实心)；

- 命名顺序：`[icon名]-[形状可选]-[描线与否]-[方向可选]`。

## 属性
|属性| 说明| 类型|默认值|
|---|----|-----|-----|
|type|图标的类型，如add、left|string|无|
|className|外部传入类，用来补充定义样式，可以改变图标的大小，颜色等|string|无|
|color|图标颜色，可以传入任意表示颜色的字符串，如'blue', '#FFF', 'rgb(0,0,0)'|string|无|
|size|常用的图标大小,目前有xs,sm,md,lg四个值|string|md|
|onClick|点击图标的回调函数|func|()=>{}|

## 如何使用
使用 `<Icon />` 标签声明组件，指定图标对应的 type 属性，示例代码如下:

``` html
<Icon type="loading" color="blue" size="sm"/>
<Icon type="close" size="md" color="#6abf47"/>
<Icon type="search" size="lg"/>
<Icon type="setup" className="biggerIcon"/>
<Icon type="empty" className="color-red"/>
```

## 注意事项
Icon组件内部样式定义采用的类是 cefc-icon- 的形式，比如cefc-icon-right,所以在组件中使用Icon，并向Icon传入className时，避免
采用cefc-icon-，以免造成样式覆盖。

---
_Source: https://npm.io/package/cefc-ui-icon · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
