Skip to main content

Button

Button

A basic button component that is looking good on any platform. This react native button is ready to handle most used scenarios which will enable you to build apps faster with cleaner code.

Button

Usage

Imports:

import { Button } from 'galio-framework';

Button

Code example:

<Button>primary</Button>
<Button color="info">info</Button>
<Button color="success">success</Button>
<Button color="warning">warning</Button>
<Button color="error">error</Button>

Button

Advanced examples:

<Button 
color="primary"
size="large"
shadowless
onPress={() => console.log('Button pressed')}
>
Press Me
</Button>

<Button
color="success"
icon="check"
iconFamily="antdesign"
iconSize={16}
loading={true}
loadingSize="small"
>
Loading Button
</Button>

Props

PropTypeDefaultDescription
childrennodenullButton content
colorstring'primary'Color options: 'primary', 'theme', 'error', 'warning', 'success', 'transparent' or custom color
sizestring'large'Size options: 'large', 'small'
disabledboolfalseDisables the button
loadingboolfalseShows loading spinner
loadingSizestring'small'Loading spinner size: 'small', 'large'
iconstringnullIcon name from Expo's icon library
iconColorstringtheme.COLORS.BLACKIcon color
iconFamilystringnullIcon family from Expo's icon library
iconSizenumber14Icon size
onlyIconboolfalseStyling for icon-only buttons
capitalizeboolfalseTransforms first character to uppercase
uppercaseboolfalseMakes all letters uppercase
lowercaseboolfalseMakes all letters lowercase
radiusnumber0Border radius
shadowlessboolfalseRemoves shadow
shadowColorstringnullCustom shadow color
opacitynumber0.8Button opacity
onPressfunctionnullPress handler function
styleobjectnullCustom styles
textStyleobjectnullCustom text styles
...TouchableOpacity.props--All TouchableOpacity props are supported