0.2.5 • Published 3 years ago

react-native-progress-bar-multi-step v0.2.5

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

progressBar

react-native-progress-bar-multi-step

https://www.npmjs.com/package/react-native-progress-bar-multi-step

Customizable multi step progress bar

Installation

npm install react-native-progress-bar-multi-step

Usage

import ProgressBarMultiStep from "react-native-progress-bar-multi-step";

// ...

const tabs = [
    {
      title: 'Personal',
      pageNo: 1
      // onPress: e => console.log(e)
    },
    {title: 'Address', pageNo: 2},
    {title: 'Payment', pageNo: 3}
  ];
  
Keys must be same with the example of tab array. onPress is a callback function which has parameter of selected pageNo.

const [page, setPage] = useState(1);

<ProgressBarMultiStep
    progressive={true}
    page={page}
    setPage={setPage}
    tabs={tabs}
/>

Properties

PropDescriptionDefaultTypeRequired
pageCurrent page number.1numberyes
setPageFunction to set statefunctionno
tabsarray of tabs object that has properties of titlearrayTabyes
progressiveif progressive is set to false only current page tab color will be activetruebooleanno
finishedBackgroundColorBackground color of the finished steps and line.'rgb(57,202,116)'stringno
inProgressBackgroundColorBackground color of the in progress steps and line.'rgb(58,153,216)'stringno
circleStyleObject of width and height keys to style step circlewidth:56, height:56objectno
stepNumberStyleObject of fontSize, fontWeight and color keysdefault:color:'white',fontWeight:'bold',fontSize: 22objectno
stepTitleStyleObject of fontSize and fontWeight keysdefault: fontWeight: 'bold', fontSize: 22.objectno
lineStyleObject of width, height and marginHorizontal keysdefault:height: 3,width: 60,marginHorizontal: 10objectno
containerStyleObject of width, height and marginTop keysdefault:height: '10%',width: '100%',marginHorizontal: 10objectno

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT