Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

comp-button

frend.wong13MIT1.0.5

basic react component

react, component

readme

comp-button

API

属性 说明 类型 默认值
extendType 拓展的按钮类型,支持 successdangerwarninginfosecondary String

其他参数与 Antd Button 一致

Example

import React from 'react';
import { render } from 'react-dom';
import { Icon } from 'antd';
import CompButton from 'comp-button';

render(
  <div style={{padding: 40}}>
    <h2>Antd Normal</h2>
    <CompButton type="primary" style={{marginRight: 20}}>primary</CompButton>
    <CompButton type="default" style={{marginRight: 20}}>default</CompButton>
    <CompButton type="dashed" style={{marginRight: 20}}>dashed</CompButton>
    <CompButton type="danger" style={{marginRight: 20}}>danger</CompButton>
    <br />
    <br />
    <h2>Custom Extend</h2>
    <CompButton extendType="success" style={{marginRight: 20}}><Icon type="check" />success</CompButton>
    <CompButton extendType="danger" style={{marginRight: 20}}>danger</CompButton>
    <CompButton extendType="warning" style={{marginRight: 20}}>warning</CompButton>
    <CompButton extendType="info" style={{marginRight: 20}}>info</CompButton>
    <CompButton extendType="secondary" style={{marginRight: 20}}>secondary</CompButton>
  </div>,
  document.getElementById('app')
);

demo

Development

$ npm run start

Build

$ npm run build

Publish

$ npm publish