1.0.4 • Published 4 years ago

@z2o/button v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

button

React Button component

npm.io npm.io npm.io

Install

$ npm install @z2o/button

Usage

import Button from '@z2o/button'

const c = <Button>default</Button>
React.render(c, container)

Example

online example: https://z2o-react.github.io/button/

API

nametypedefaultdescription
prefixClsstringz2o-button类名前缀
classNamestring-为 button 添加额外的类名
styleObject-为 button 添加 style
typestringdefaultprimarydangersuccess
sizestringmediumlargesmall
blockBooleanfalse是否以块级元素的形式展开
hrefstring-点击跳转的地址,指定此属性 button 的行为和 a 链接一致
targetstring-相当于 a 链接的 target 属性,href 存在时生效
htmlTypestringbutton原生的 type 值
disabledBooleanfalse禁用
loadingBooleanfalse是否加载中状态
outlineBooleanfalse边框有颜色,内部没有颜色
onClick(event) =>-点击按钮时的回调

支持原生 button 的其他所有属性,除了上表中的属性,其它属性都会直接传到原生 button 上。

License

@z2o/button is released under the MIT license.