Button
Button components helps to handle all user actions using onPress handlers, the button component has some types defined inside it which display various form of buttons on the basis of that,any time you can customize it by passing the custom styles. On the lower level it uses react-native-material-ripple
Usage
Props
onPress
Function to be called when user taps on the button
Type | Default | Required |
---|---|---|
function | None | Yes |
label
Label to display inside the button
Type | Default | Required |
---|---|---|
string | None | Yes |
type
On the basis of type passed to component, it applies the defined style to it
Type | Default | Values | Required |
---|---|---|---|
string | primary | primary or secondary | No |
loading
loading ensures that user see some indicator while some action is getting done,it also disables onPress when loading is true so that function call can be atomic.
Type | Default | Required |
---|---|---|
boolean | false | No |
disabled
disabled make sure if its true then user won't be able to click it and the onPress would not get called
Type | Default | Required |
---|---|---|
boolean | false | No |
customStyles
A react native style object which takes care of styling the button component as per your needs
Type | Default | Required |
---|---|---|
ViewStyle | none | No |