npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@lycm/text-avatar

v1.0.0

Published

文字头像组件

Downloads

5

Readme

文字头像组件

安装

npm i @lycm/text-avatar --save

使用

import React from 'react';
import { message } from 'antd';
import TextAvatar from '@lycm/text-avatar';

export default props => {
	const user = {
	    id: 10,
		account: 'xiaoming',
		empStatus: 1,
		nickname: '王小明'	 
	};

	const cardConfig = [
		{
			label: '部门',
			value: '企业技术部-PaaS-UED'
		},
		{
			label: '邮箱',
			value: '[email protected]'
		}
	];

	return (
		<TextAvatar
			{...user}
			cardConfig={cardConfig}
			onClick={() => {
				message.info('跳转链接');
			}}
		/>
	);
};

API

组件API

|参数 |数据类型 |是否必填 |默认值 |备注 | | ---- | ---- | ---- | ---- | ---- | | nickname | String | 是 | - | 用户昵称 | | account | String | 是 | - | 用户账号,用来判断使用颜色 | | empStatus | number | 否 | 1 | 用户状态,1是正常状态,2则为灰色 | | showPopover | boolean | 否 | true | 是否显示popover浮层 | | size | number | 否 | 32 | 头像大小(宽高) | | linearGradient | boolean | 否 | false | 是否渐变 | | randomColor | boolean | 否 | true | 是否随机颜色,如果不随机,则为固定蓝色 | | onClick | function | 否 | - | 卡片内的头像点击 | | theme | String | 否 | default | 卡片内的主题,default、plant | | sameAsChildren | boolean | 否 | true | 卡片内的头像是否和children一样 |

浮层相关API

|参数 |数据类型 |是否必填 |默认值 |备注 | | ---- | ---- | ---- | ---- | ---- | | trigger | String | 否 | hover | 浮层详情显示方式,同Popover | | placement | String | 否 | rightTop | 浮层详情显示位置,同Popover | | cardConfig | Array | 是 | [] | 卡片内的详情配置 | | onClick | function | 否 | - | 卡片内的头像点击 |