1.2.7 • Published 10 months ago

react-native-custom-ui-stepper v1.2.7

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

react-native-custom-ui-stepper.

npm version npm version

Examples

Un componente de React Native que refleja la funcionalidad de UIStepper de iOS.

Un control de stepper proporciona una interfaz de usuario para incrementar o decrementar un valor. Un stepper muestra dos botones: uno con un símbolo de menos (“–”) y otro con un símbolo de más (“+”).

Ahora puedes configurar tu react-native-custom-ui-stepper para que sea vertical

Instalación

npm i react-native-custom-ui-stepper

Utilización

import UIStepper from 'react-native-custom-ui-stepper';
...
setValue = (value) => {
  // do something with value
}
render() {
  return (
      <UIStepper
        onValueChange={(value) => { this.setValue(value) }}
      />
  )
}

Ahora puedes usar imágenes personalizadas, ya sea desde tu sistema de archivos local o desde Internet. Consulta Props para más detalles.

Demo

Demo example

Props

NombreTipoDescripciónValor por defecto
initialValueNumberValor inicial0
valueNumberSobrescribir forzosamente el valor0
minimumValueNumberValor mínimo0
maximumValueNumberValor máximo100
stepsNumberValor de incremento1
displayValueBooleanMuestra el valor del stepper entre el botón de incremento y el de decrementofalse
incrementImageString or NumberSobrescribir la imagen de incremento predeterminadarequire('./assets/increment.png')
decrementImageString or NumberSobrescribir la imagen de decremento predeterminadarequire('./assets/decrement.png')
wrapsBooleanCuando se establece en verdadero, incrementar más allá del maximumValue establecerá el valor en minimumValue y viceversafalse
tintColorStringCambia el color de todos los píxeles no transparentes al tintColor#0076FF
overrideTintColorBooleanAl usar una imagen externa, establece si deseas que el tintColor se aplique a los píxeles no transparentes.false
backgroundColorStringColor de fondotransparent
verticalBooleanMuestra un UI Stepper vertical. Debes especificar una altura y un ancho.false
displayDecrementFirstBooleanMuestra el botón de decremento encima del botón de incremento, solo funciona cuando vertical es truefalse
widthNumberAncho94
heightNumberAlto29
textColorStringEl color de texto deseado que se usará cuando displayValue esté configurado como true#0076FF
fontFamilyStringLa familia de fuente utilizada en el valor mostrado cuando displayValue esté configurado como trueSystem
fontSizeNumberEl tamaño de fuente utilizado en el valor mostrado cuando displayValue esté configurado como true15
borderColorStringColor utilizado para el borde#0076FF
borderWidthNumberAncho del borde1
borderRadiusNumberRadio del borde4
onValueChangeFunctionEjecutada cuando el valor cambia. El valor se pasa como parámetronull
onIncrementFunctionEjecutada cuando el usuario hace clic en el botón de incremento (+). El valor se pasa como parámetronull
onDecrementFunctionEjecutada cuando el usuario hace clic en el botón de decremento (–). El valor se pasa como parámetronull
onMinimumReachedFunctionEjecutada cuando se alcanza el minimumValue. El valor se pasa como parámetronull
onMaximumReachedFunctionEjecutada cuando se alcanza el maximumValue. El valor se pasa como parámetronull
innerRefFunctionUna referencia al UIStepper renderizado. Puedes usar esto para acceder a métodos basados en clases. increment(), decrement(), resetValue() y setValue() son los más comunesnull

Contribuciones

No hay requisitos para contribuir al paquete react-native-custom-ui-stepper. Puedes Navegar a o plantear problemas en los que te gustaría contribuir.

Haz un fork del repositorio en Github Clona el proyecto Realiza cambios y súbelos a tu rama forkeada Envía tus cambios a tu rama Envía un Pull Request para que se pueda fusionar en react-native-custom-ui-stepper

Ejecutar ejemplo

$ git clone https://github.com/tahelromero/react-native-custom-ui-stepper.git
$ cd example
$ yarn # or npm install
$ react-native run-ios

react-native-custom-ui-stepper

npm version npm version

Examples

A react-native component which mirrors the functionality of UIStepper from iOS.

A stepper control provides a user interface for incrementing or decrementing a value. A stepper displays two buttons, one with a minus (“–”) symbol and one with a plus (“+”) symbol.

You can now configure your react-native-custom-ui-stepper to be vertical

Installation

npm i react-native-custom-ui-stepper

Usage

import UIStepper from 'react-native-custom-ui-stepper';
...
setValue = (value) => {
  // do something with value
}
render() {
  return (
      <UIStepper
        onValueChange={(value) => { this.setValue(value) }}
      />
  )
}

You can now use custom images, from your local file system or from the Internet. See Props for more details.

Demo

Demo example

Props

NameTypeDescriptionDefault
initialValueNumberStart value0
valueNumberForcibly override the value0
minimumValueNumberMinimum value0
maximumValueNumberMaximum value100
stepsNumberIncrement value1
displayValueBooleanDisplays the stepper value between the increment and decrement buttonfalse
incrementImageString or NumberOverride the default increment imagerequire('./assets/increment.png')
decrementImageString or NumberOverride the default decrement imagerequire('./assets/decrement.png')
wrapsBooleanWhen set to true, incrementing beyond the maximumValue will set the value to minimumValue and vice versafalse
tintColorStringChanges the color of all the non-transparent pixels to the tintColor.#0076FF
overrideTintColorBooleanWhen using an external image, set whether you want the tintColor to be applied to non-transparent pixels.false
backgroundColorStringBackground colortransparent
verticalBooleanDisplay a vertical UI Stepper. You must specify a height and a width.false
displayDecrementFirstBooleanDisplay the decrement button above the increment button, only works when vertical is truefalse
widthNumberWidth94
heightNumberHeight29
textColorStringThe desired text colour which will be used when displayValue is set to true#0076FF
fontFamilyStringThe font family used on the value displayed when displayValue is set to trueSystem
fontSizeNumberThe font size used on the value displayed when displayValue is set to true15
borderColorStringColor used for the border#0076FF
borderWidthNumberWidth of the border1
borderRadiusNumberRadius of the border4
onValueChangeFunctionExecuted when the value changes. The value is passed as a parameternull
onIncrementFunctionExecuted when the User clicks the increment (+) button. The value is passed as a parameternull
onDecrementFunctionExecuted when the User clicks the decrement (+) button. The value is passed as a parameternull
onMinimumReachedFunctionExecuted when the minimumValue is reached. The value is passed as a parameternull
onMaximumReachedFunctionExecuted when the maximumValue is reached. The value is passed as a parameternull
innerRefFunctionA reference to the rendered UIStepper. You can use this to gain access to class-based methods. increment(), decrement(), resetValue() and setValue() are most commonly usednull

Contributing

There are no requirements for contributing to the react-native-custom-ui-stepper package. You can browse or raise issues that you are would like to contribute to.

  1. Fork the repository on Github
  2. Clone the project
  3. Commit changes to your forked branch
  4. Push your changes to your branch
  5. Submit a Pull Request so that it can be merged into react-native-custom-ui-stepper

Run Example

$ git clone https://github.com/tahelromero/react-native-custom-ui-stepper.git
$ cd example
$ yarn # or npm install
$ react-native run-ios
1.2.7

10 months ago

1.2.6

10 months ago

1.2.5

10 months ago

1.2.4

10 months ago