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

@beisen-phoenix/tag

v3.3.55

Published

> @beisen-phoenix/tag

Downloads

422

Readme

标签组件

@beisen-phoenix/tag

概述

进行标记和分类的小标签。

API

不可选择标签 | 参数 | 说明 | 类型 | 默认值 | 是否必传 | | --- | --- | --- | --- | --- | | type | 按钮的类型,可选值为'standard'和'circle' | string | 'standard' | No | | theme | 主题类型,可选值为'light'和'dark' | string | 'dark' | No | | fit | 深色适配,当前标签是否显示在深色背景上。当标签显示在深色背景上时,自动做颜色调整 | boolean | - | No | | color | 主题颜色,只支持#ffffff这样的颜色格式。如果是其他颜色格式,请做一次转换。 | string | - | No | | extraCls | 自定义组件容器class,一般用于覆盖组件默认样式使用 | string | - | No | | onClick | 点击事件回调 | (e:MouseEvent) => void | - | No |

可选择标签 | 参数 | 说明 | 类型 | 默认值 | 是否必传 | | --- | --- | --- | --- | --- | | selected | 标签的选中状态 | boolean | false | No | | disabled | 标签是否禁用 | string | false | No | | size | 标签的大小,默认为正常大小,可选有'default'和'lg' | string | 'default' | No | | extraCls | 自定义组件容器class,一般用于覆盖组件默认样式使用 | string | - | No | | onClick | 点击事件回调 | (e:MouseEvent) => void | - | No |

用法

import React from 'react';
import Tag, {SelectableTag} from '@beisen-phoenix/tag';

export default function TagEx(props) {
  return <>
    <Tag type="standard" theme='light' color="#1890ff">xxxxs</Tag>
    <Tag type="standard" theme='dark' color="#1890ff">xxxxs</Tag>
    <Tag type="circle" theme='light' color="#1890ff">xxxxs</Tag>
    <Tag type="circle" theme='dark' color="#1890ff">xxxxs</Tag>
    <SelectableTag maxWidth={70} selected={true} onClick={() => void} size="lg">可选择标签</SelectableTag>
  </>
  
}

默认Tag参数说明

type: string

按钮的类型, 可选值为standard | circle 默认值为default。当为standard的时候,显示的是小圆角,当为circle的时候,显示的是大圆角

theme: string

主题类型(仅小圆角支持,大圆角无主题类型),可选值为light | dark。默认值为dark。当为light的时候,显示浅色底,深色字和边框,当为dark时,显示深色底,和白色字

color: string

主题颜色,只支持#ffffff这样的颜色格式。如果是其他颜色格式,请做一次转换。

fit: boolean

深色适配,当标签显示在深色背景上时,自动做颜色调整

onClick: (e:MouseEvent) => void;

点击事件回调

SelectableTag参数说明

selected?: boolean

标签的选中状态,true为选中,false为没选中

size?: ESelectTagSize

标签的大小,默认为正常大小,可选有'lg',更大一点

onClick?: (e:MouseEvent) => void;

点击事件回调

extraCls?: string

自定义组件容器class,一般用于覆盖组件默认样式使用