Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 1.51 KB

Icon.md

File metadata and controls

53 lines (39 loc) · 1.51 KB
name title route
Icon
图标
/components/Icon

Icon

图标组件。

使用 Image 元素实现,并且在本组件库的其他组中使用。因为 Android 平台不支持 tintColor 属性,所以使用场景很有限,请根据自己的实际情况使用。推荐在自己的项目中集成字体文件功能。

Usage

全部引入

import { Icon } from 'beeshell';

按需引入

import { Icon } from 'beeshell/dist/components/Icon';

Examples

image

Code

详细 Code

import { Icon } from 'beeshell'

<Icon type='angle-down' size={14} tintColor='#FECB2E' />
<Icon source={require('beeshell/dist/common/images/icons/angle-down.png')} size={14} tintColor='#FECB2E' />
// 可以用上面两种方式,使用同一个图标
// 第二种方式 source 属性的图片名(angle-down)与第一种方式的 type 属性一致
// 注意使用 RN 默认 JS 打包方案的,只能使用第二种方式

<Icon type='times-circle-o' size={20} tintColor='red' />

API

Props

Name Type Required Default Description
style ImageStyle false {} 样式
type string true 'angle-down' 图标类型
size number false 20 图标大小
tintColor string false brandPrimaryDark 的色值 图标颜色,注意只支持 iOS 平台
source ImageSourcePropType false null 自定义图片