1.0.1 • Published 5 years ago

react-native-toolbar-controls v1.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

react-native-toolbar-controls

react native toolbar with controls components support android and IOS, you can pass the props and dataset you need to get the view as you want it. It works on diffrent devices screens from 4 inch mobile screens to 10 inch screens, the example on landscape screen

ScreenShots

screenshots1 screenshots2

Installation

npm install --save react-native-toolbar-controls

Components

Reference components used in react-native-toolbar-controls:

Usage

import ToolBarControl from 'react-native-toolbar-controls';

          <View>
                        <ToolBarControl segmentControlDataSet={options}
                                 centerControl={"SegmentControl"}
                                 selectedOption={"Start"}
                                 onPressSegmentControl={(option, index)=>{ console.log(option, index)}}
                                 leftControl={"Icon"}
                                 rightControl={"Switch"}
                                 leftIconName={"menu"}
                                 switchActiveText={"TS"}
                                 switchInActiveText={"TM"}
                                 onSwitchValueChange={(value)=>{console.log(value)}}
                                 onPressRightIcon={()=>{ console.log("onPressRightIcon")}}
                                 onPressLeftIcon={()=>{ console.log("onPressLeftIcon")}}
                                 rightIconName={'menu'}
                                 rightText={"RIGHT"}
                                 centerText={this.state.password}/>
          </View>

Toolbar Props

Left Control
Prop nameTypeDescription
leftControlstringkeyname default is "Icon" ("Icon"/"Text")
leftIconNamestringicon name default is "menu"
leftIconColorstringicon color default is "#fff"
onPressLeftIconfunctioncallback on press left Icon
leftTextstringText view default is "Left Text"
leftControlTextContainerStyleobject stylestext container style
leftControlTextStyleobject stylestext style
Center Control
Prop nameTypeDescription
centerControlstringkeyname default is "Icon" ("SegmentControl"/"Text")
centerTextstringtext view default is "Center Text"
centerControlTextContainerStyleobject stylestext container style
centerControlTextStyleobject stylestext style
segmentControlDataSetarrayarray of items like "Start", "Stop", "Recover"
segmentControlSelectedOptionstringdefault value 'Start'
onPressSegmentControlfunctioncallback for (option, index) on segment control change
segmentControlHeightnumberdefault value 6*viewPortMax, resizable
segmentControlTabStyleobject stylessegmentControl container style
segmentControlActiveTabStyleobject stylessegmentControl active container style
segmentControlTabTextStyleobject stylessegmentControl text style
segmentControlActiveTabTextStyleobject stylessegmentControl active text style
segmentControlBorderRadiusnumberdefault value 6.4 for border radius
Right Control
Prop nameTypeDescription
rightControlstringkeyname default is "Switch" ("Switch"/"Text"/"Icon")
rightTextstringtext view default is "Right Text"
rightControlTextContainerStyleobject stylestext container style
rightControlTextStyleobject stylestext style
rightIconNamestringdefault icon name is "map"
rightIconColorstringdefault icon color is "purple"
onPressRightIconfunctioncallback on press left Icon
switchActiveTextstringdefault icon name is "ON"
switchInActiveTextstringdefault icon name is "OFF"
onSwitchValueChangefunctioncallback on value change is boolean (True/False)
toolbarHeightstringheight size set in percentage (%) of screen size and default value ('12.3%')