Skip to main content
Version: 1.0.0

Button

Button components render a pre-styled button that can easily be re-style by using props.

Example banner Example banner

Implementation code

import { Button, Icon } from 'rn-nativeflow';
import { ArrowRight } from 'lucide-react-native';

const Component = () => {
return (
<Button
variant='outlined'
title='Open'
rightIcon='Send'
renderRightIcon={<Icon renderIcon={<ArrowRight size={17} color='white' />} />}
onPress={() => console.log('Button clicked!'))}
/>
);
}
export default Component;

Props

PropTypeDefaultDescription
variantoutlined, containedcontained
typeround, flatflat
fullWidthbooleanfalse
paddingHnumber30 with fullWidth prop and 20 without fullWidth propHorizontal padding of the button
bgstring#000Background color of the button
brnumber5Border radius of the button and it works when type='flat'
strokenumber1Border width of the button and it works when variant='outlined'
strokeColorstringBorder color of the button and it works when variant='outlined'
titlestringButtonSet title of the button
titleColorstring#000Set title color of the button
titleFSnumber12Set title size of the button
titleFFstringSet title font family of the button
titleFFstringSet title font family of the button
sizenumber50Set the size of the button and it works when type='round'
disabledbooleanfalseWhen true, this will disable the button
renderIconJSX.ElementSet custom icon of the button and it works when type='round'
renderLeftIconJSX.ElementSet custom left icon of the button and it works when type='flat'
renderRightIconJSX.ElementSet custom right icon of the button and it works when type='flat'
onPressfunctionCalls when someone click on button
buttonContainerStyleobjectHelps to change the styles of the button container
textStyleobjectHelps to change the styles of the button text