diff --git a/README.md b/README.md index ac600e8..654b684 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,8 @@ const customStyles = { stepIndicatorLabelUnFinishedColor: '#aaaaaa', labelColor: '#999999', labelSize: 13, - currentStepLabelColor: '#fe7013' + currentStepLabelColor: '#fe7013', + animationDuration:200 } @@ -121,6 +122,7 @@ onPageChange(position){ | ```labelSize``` | Number | 13 | ```labelAlign``` | String | 'center' | ```labelFontFamily``` | String | +| ```animationDuration```|Number | 200 ### Contributing diff --git a/src/index.tsx b/src/index.tsx index 222aeb6..484b79a 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -49,6 +49,7 @@ interface DefaultStepIndicatorStyles { | undefined; currentStepLabelColor: string; labelFontFamily?: string; + animationDuration?:number; } const defaultStyles: DefaultStepIndicatorStyles = { @@ -76,6 +77,7 @@ const defaultStyles: DefaultStepIndicatorStyles = { labelSize: 13, labelAlign: 'center', currentStepLabelColor: '#4aae4f', + animationDuration:200, }; const StepIndicator = ({ @@ -397,7 +399,7 @@ const StepIndicator = ({ Animated.sequence([ Animated.timing(progressAnim, { toValue: isNaN(animateToPosition) ? 0 : animateToPosition, - duration: 200, + duration: customStyles.animationDuration, useNativeDriver: false, }), Animated.parallel([