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
title='Open'
fullWidth
renderRightIcon={<Icon renderIcon={<ArrowRight size={17} color='white' />} />}
onPress={() => console.log('Button clicked!')}
/>
);
};

export default Component;

Props

PropTypeDefaultDescription
variantcontained | outlined'contained'Specifies the button style variant.
type'round' | 'flat''flat'Determines the button shape.
fullWidthbooleanfalseExpands the button to occupy the full width.
paddingHnumber30 (if fullWidth is true) / 20 (otherwise)Horizontal padding inside the button.
paddingVnumber12Vertical padding inside the button.
bgstringtheme.colors.brand.primaryCustom background color (for contained buttons).
brnumber5Border radius of the button.
strokenumber1Border width (for outlined variant).
strokeColorstringtheme.colors.brand.primaryBorder color (for outlined variant).
titlestring'Button'Text (label) displayed on the button.
titleColorstring#000Color of the button text.
fsnumber14Font size of the button text.
fScaleTypographyScale'base'Typography scale for the button text.
sizenumber50Button size (applies when type="round").
rippleColorstringtheme.colors.states.pressedRipple effect color on press.
renderIconJSX.ElementSingle icon placed at the center (mostly for round buttons).
renderLeftIconJSX.ElementIcon displayed before the button text.
renderRightIconJSX.ElementIcon displayed after the button text.
disabledbooleanfalseDisables the button when true.
containerStyleStyleProp<ViewStyle>Custom styles for the button container.
titleStyleStyleProp<TextStyle>Custom styles for the button text.
onPress() => voidFunction to execute when the button is pressed.