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

antd-button-group

v2.0.0

Published

超过一定数量的按钮将展示在`Dropdown`中

Downloads

14

Readme

ButtonGroup

介绍

  1. 本组件基于ReactAnt Design,适用于React + Ant Design项目
  2. 本组件设计为超过一定数量的按钮将展示在Dropdown

sample

使用方式

安装

npm i antd-button-group

使用

@import '~antd/dist/antd.less'; // 引入antd样式
@import '~antd-button-group/dist/index.less';
import ButtonGroup from 'antd-button-group'

<ButtonGroup>
  <Button size='small' type='link' onClick={() => message.success('编辑')}>编辑</Button>
  <Button size='small' type='link' danger onClick={() => message.warning('删除')}>删除</Button>
  <Button size='small' type='link' onClick={() => message.success('随便什么操作')}>随便什么操作</Button>
  <Button type='primary' onClick={() => message.success('primary to link')}>primary to link</Button>
  <Button size='small' type='link' danger onClick={() => message.error('按钮 danger')}>按钮 danger</Button>
  <Divider />
  <a onClick={() => message.success('a标签')}>a标签</a>
</ButtonGroup>

API

Props

| 属性 | 说明 | 类型 | 默认值 | 可选值 | | :--------- | :----------------------------------- | -------------- | :----------------------------------------------------------- | ------------------------------------------------------------ | | outerCount | 外部显示几个按钮,其余放在Dropdown中 | Number、String | 2 | | | direction | 内置icon的排列方向 | String | row(横向) | column | | placement | Dropdown弹出位置 | String | bottomLeft | bottomLeftbottomCenterbottomRighttopLefttopCentertopRight | | arrow | Dropdown下拉框箭头是否显示 | Boolean | false | | | trigger | 触发下拉的行为, 移动端不支持 hover | Array | ['click'] | clickhovercontextMenu | | icon | 右侧更多 icon | ComponentType | Antd Icon MoreOutlined | | | iconStyle | 右侧更多 icon 样式 | CSSProperties | { fontSize: 22, verticalAlign: 'middle', marginLeft: 2 } | | | children | 按钮 | ReactNode | - | |

children

| PropTypes.node | 说明 | | :----------------------------------------------------------- | :----------------------------------------------------------- | | <Button type='primary'>按钮</Button> | Dropdown中的Button将会自动转为<Button type='link'>按钮</Button> | | <Menu.Divider /> | 使用该组件渲染分割线 | | <Button type='primary' disabled>按钮</Button><a disabled onClick={() => message.success('a标签')}>a标签</a> | disabled不可用 |