Home > Mobile >  adding padding between labels and indicator, react-native-step-indicator
adding padding between labels and indicator, react-native-step-indicator

Time:02-22

Using this enter image description here

How to add paddingTop on labels?

CodePudding user response:

Implement your own <CustomLabel> component and give it to the <StepIndicator> component via the renderLabel property:

<StepIndicator
     customStyles={customStyles}
     currentPosition={this.state.currentPosition}
     labels={labels}
     renderLabel={<CustomLabel ... style={{paddingTop: x}}>} //x is your padding above the lable
/>

The <CustomLabel> component could just be a <Text> component using the props that are given from the <StepIndicator> component.

  • Related