Create Stylish button instantly and efficiently
Native Cli: npm install react-native-kumbutton
Expo: expo install react-native-kumbutton
import React from 'react'
import {View, Text} from 'react-native'
import {Button} from 'react-native-kumbutton'
export default function App(){
return(
<View style={{justifyContent: 'center',alignItems: 'center'}}>
<Text>Default (Solid)</Text>
<Button
text={'Hello world!'}
/>
<Text>Default (Outline)</Text>
<Button
buttonType={'outline'} //default 'solid'
text={'Hello world!'}
//default onPress = () => console.log('Button Clicked!')
/>
<Text>Stylish (Solid)</Text>
<Button
buttonType={'solid'}
style={{borderRadius: 20,borderColor: 'blue',backgroundColor: 'blue',padding: 10}}
text={'Hello world!'}
textStyle={{color: 'white',fontSize: 16}}
clickOpacity={0.4}
onPress={()=>console.log('Hello world (Solid)')}
/>
<Text>Stylish (Outline)</Text>
<Button
buttonType={'outline'}
style={{borderRadius: 20,borderColor: 'blue',padding: 10}}
text={'Hello world!'}
textStyle={{color: 'blue',fontSize: 16}}
clickOpacity={0.4}
onPress={()=>console.log('Hello world (Outline)')}
/>
</View>
);
}
Props | Type | Default | Description |
---|---|---|---|
buttonType | String | 'solid' | valid values: ['solid','outline'] |
style | Object | null | |
text | String | 'Click Me!' | |
textStyle | Object | null | |
clickOpacity | Number | 0.2 | range (0-1) |
onPress | Function | ()=>console.log('Button Clicked!') |