Skip to main content

Button

Button components render a pre-styled button that can be easily customized using props.

Example button light mode Example button dark mode

Implementation Code

import { Button, Icon } from '@nexara/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, contained'contained'Defines the button style (outlined or contained).
typeround, flat'flat'Defines the button shape (round or flat).
fullWidthbooleanfalseExpands button to full width if set to true.
paddingHnumber30 (if fullWidth is true) / 20 (otherwise)Defines the horizontal padding of the button.
bgstringtheme.colors.primarySets the background color of the button.
brnumber5Defines the border radius of the button (applies when type='flat').
strokenumber1Defines the border width (applies when variant='outlined').
strokeColorstringundefinedDefines the border color (applies when variant='outlined').
titlestring'Button'Sets the text label of the button.
titleColorstring#000Sets the color of the button text.
titleFSnumber12Defines the font size of the button text.
titleFFstringundefinedDefines the font family of the button text.
sizenumber50Defines the button size (applies when type='round').
disabledbooleanfalseDisables the button when set to true.
renderIconJSX.ElementundefinedRenders a custom icon inside a round button.
renderLeftIconJSX.ElementundefinedRenders a custom left icon inside a flat button.
renderRightIconJSX.ElementundefinedRenders a custom right icon inside a flat button.
onPressfunctionundefinedCallback function triggered when the button is pressed.
buttonContainerStyleViewStyleundefinedCustom styles for the button container.
textStyleTextStyleundefinedCustom styles for the button text.