A parity version of the iOS UIStepper.
npmignore
to exclude RELEASE_NOTES.md
and .gitattributes
files.This has been refactored as a functional Typescript component. In addition, consolidated the ImageView and Step components into the parent component. Furthermore, the ability to control color easily was implemented, see new props useColor
and color
, as a result several styles were changed and default color scheme is black
to match the default image colors.
textStyle
defaults changed to {marginHorizontal: 8, fontSize 24}
.containerStyle
defaults changed to {flexDirection: 'row', borderWidth: 1, borderRadius: 8, alignItems: 'center',justifyContent: 'space-evenly'}
separatorStyle
's default backgroundColor change to black
.incrementStepStyle
and decrementStepStyle
's padding changed to 4.incrementImageStyle
and decrementImageStyle
height
and width
changed to 30.renderText
passed arguments changed to value
number.renderDecrementStep
passed arguments changed to value
number and onDecrement
function.renderIncrementStep
passed arguments changed to value
number and onIncrement
function.renderDecrementImage
passed arguments changed to opacity
number.renderIncrementImage
passed arguments changed to opacity
number.disableIncrementImageTintColor
as name implies, defaults to false
.disableDecrementImageTintColor
as name implies, defaults to false
.useColor
defaults to false
and works in-conjunction with color
to apply a color to the stepper styles.color
defaults to blue
and works in-conjunction with useColor
to apply color to containerStyle
's border color, separatorStyle
's backgroundColor, incrementImageStyle
's tintColor, decrementImageStyle
's tintColor and textStyle
's color if showText
enabled.textDecimalPlaces
defaults to 2 and formats the value
number when showText
is enabled and is not an integer.Changelog
FIXES
componentWillRecieveProp
life cycle method so I added prefix UNSAFE
to adhere to warning.Changelog
BREAKING CHANGES
tintColor
has been removed.backgroundColor
has been removed.padding
has been removed.tintOnIncrementImage
has been removed.tintOnDecrementImage
has been removed.renderIncrement
has been replaced by combination of render functions.renderDecrement
has been replaced by combination of render functions.imageHeight
has been removed.imageWidth
has been removed.See props for replacements and style objects.
FEATURES
showText
and textPosition
).onMin
and onMax
to callback when value reaches min or max.onIncrement
and onDecrement
to callback when value increments or decrements.Step
component. Thanks @iRoachievalueChanged
was invoked on initial render.To use 2.0.0 and beyond please update your import to:
import { SimpleStepper } from 'react-native-simple-stepper';
I refactored the internals with the following improvements and updates: