Package Exports
- react-native-button-spinner
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-button-spinner) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-native-button-spinner 
Buttons spinners plugin for react-native
Getting Started
npm i react-native-button-spinner --save
Usage
import ButtonSpinner from 'react-native-button-spinner';
...
// Your button
<ButtonSpinner>
My text button 1
</ButtonSpinner>
<ButtonSpinner
disabled={true}
test={false}
>
My text button 2
</ButtonSpinner>
<ButtonSpinner
style={{ backgroundColor: 'blue' }}
disabled={true}
opacityDisabled={0.1}
>
My text button 3
</ButtonSpinner>
<ButtonSpinner
onPress={this.test1}
>
My text button 4
</ButtonSpinner>
Props
children
textButton
disabled
opacity
opacityDisabled
pendingRequest
automaticTimeEnable
style
styleText
styleSpinner
typeSpinner
positionSpinner
customSpinnerComponent
onPress
Reference
children
Text Button (use textButton or children)
Type | Default |
---|---|
React Native Component (React.ReactElement ) |
none |
Example use children:
<ButtonSpinner>My Default Button</ButtonSpinner>
OR
<ButtonSpinner>
<Text>My Text</Text>
</ButtonSpinner>
textButton
Text Button (use children or textButton)
Type | Default |
---|---|
string | My Button text |
Example use children:
<ButtonSpinner textButton={'Text Button'}/>
disabled
Disable state button click
Type | Default |
---|---|
boolean | false |
opacity
Default opacity button
Type | Default |
---|---|
number | 1 |
opacityDisabled
Default opacity button when disabled state
Type | Default |
---|---|
number | 0.35 |
pendingRequest
Waiting for function to complete
Type | Default |
---|---|
boolean | true |
automaticTimeEnable
Time after which the button becomes active without waiting for the function to complete after number
second(s).
Example set 2s. automaticTimeEnable={2000}
Type | Default |
---|---|
number | 0 |
style
add additional styling for button component (optional)
Type | Default |
---|---|
View style (object) | see code below |
{
alignItems: 'center',
backgroundColor: 'f5f5f5',
color: '#dddddd',
paddingVertical: 10,
paddingHorizontal: 25,
margin: 10,
borderColor: '#c2c2c2',
borderRadius: 5,
borderWidth: 1,
flex: 1,
flexDirection: 'row',
justifyContent: 'center',
}
styleText
add additional styling for button text (optional)
Type | Default |
---|---|
View style (object) | { color: '#000000' } |
styleSpinner
Style for button spinner if not use customSpinnerComponent
size has option:
small
large
Type | Default |
---|---|
View style (object) | { style: { marginRight: 15, }, color: '#a6a6a6', size: 'small' } |
typeSpinner
Type button spinner loader (optional):
defaut
custom
Type | Default |
---|---|
defaut , custom |
defaut |
positionSpinner
Position button spinner (optional):
left
right
centered-over-text
centered-without-text
left-without-text
right-without-text
above-text
below-text
Position button spinner if not use customSpinnerComponent.
Type | Default |
---|---|
left , right , centered-over-text , centered-without-text , left-without-text , right-without-text , above-text , below-text |
left |
customSpinnerComponent
Custom button spinner component
Type | Default |
---|---|
React Native Component (React.ReactElement ) |
none |
onPress
Your function for click
Type | Default |
---|---|
function | () => {} |
License
This project is licensed under the MIT License - see the LICENSE file for details
Copyright (c) 2019 Igor Rosliakov