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

primary-button
secondary-button

Usage

// react base imports
import { Button } from 'frontatish';
// primary button
<Button
type="primary"
label="primary button"
onPress={() => console.log('Pressed')}
/>
// secondary button
<Button
label="secondary button"
type="primary"
onPress={() => console.log('Pressed')}
/>

Props

onPress

Function to be called when user taps on the button

TypeDefaultRequired
function NoneYes

label

Label to display inside the button

TypeDefaultRequired
string None Yes

type

On the basis of type passed to component, it applies the defined style to it

TypeDefaultValuesRequired
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.

TypeDefaultRequired
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

TypeDefaultRequired
boolean false No

customStyles

A react native style object which takes care of styling the button component as per your needs

TypeDefaultRequired
ViewStyle none No