cricket-trial-kit
v1.0.1
Published
Delivering different key components as npm packages for cricket australia products
Downloads
7
Readme
Npm package for cricket toolkit
Packages created in React and are imported in different projects.
- Bundled with Webpack
Usage
- Open console
- Type or copy
yarn add cricket-toolkit
. - import using
import Button from 'cricket-toolkit'
- Use the Button component in your components
Props
- url:
Accepts a string.
URL of the page the component will redirect to. If no URL is provided then the output is a
<button></buttom>
instead of<a></a>
. - newPage:
Accepts a boolean.
Only available on a Button with url, it'll indicate if target is set to
_blank
. - size: Accepts a string. Valid inputs 'small', 'large'. Will change the button padding accordingly.
- shouldFitContainer:
Accepts a boolean value.
If set to
true
button will fit the width of parent container. - btnText: Accepts a string. This field is mandatory. This is the button call to action.
- btnClass: Accepts any string. This will define button theme and style.
- clickHandler: Accepts a function. Defines interaction of the button when clicked on.
Resources
- http://kloc.io/setting-up-react-workflow-babel-webpack/
- https://facebook.github.io/jest/docs/webpack.html
- https://webpack.js.org/guides/code-splitting-libraries/#manifest-file