Skip to content

ybzjsxh/color-statistics

Repository files navigation

color-statistics

React color-statistics

NPM version build status

node version npm download

Screenshot

Browsers support

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Opera
Opera
IE 8 + ✔ Firefox 31.0+ ✔ Chrome 31.0+ ✔ Safari 7.0+ ✔ Opera 30.0+ ✔

Install

color-statistics

Usage

var Statistics = require('color-statistics');
var React = require('react');
var ReactDOM = require('react-dom');

ReactDOM.render(
  <Statistics title='' align='left' type='success' tip={<span>Statistics</span>} />,
  container,
);

Examples

npm start and then go to http://localhost:9001

Online examples: github-pages or vercel

API

Props

name type default description
style? React.CSSProperties {} custom container style
titleStyle? React.CSSProperties {} custom title style
numberStyle? React.CSSProperties {} custom number style
tipStyle? React.CSSProperties {} custom tip style
type string 'primary' one of ['primary', 'success', 'warning', 'info']
align string 'right' one of ['left','right','top','bottom', 'topLeft', 'topRight', 'bottomLeft', 'bottomRight']
showTip boolean | string true show tip icon or not
tip string | ReactNode '' tips info
number string | number number

Development

npm install
npm start

Test Case

npm test
npm run chrome-test

Coverage

npm run coverage

License

color-statistics is released under the MIT license.