Skip to main content
Version: 4.0.0-beta.0

Button

Buttons are touchable elements used to interact with the screen and to perform and operation.

They may display text, icons, or both. Buttons can be styled with several props to look a specific way.

Also receives all TouchableNativeFeedback (Android) or TouchableOpacity (iOS) props.

Usage

LinearGradient Usage

Using LinearGradient in React Native Elements is supported through the react-native-linear-gradient package. If you're using expo or create-react-native-app then you can use linearGradientProps prop right out the box with no additional setup.

For react-native-cli users, make sure to follow the installation instructions and use it like this:

import { Button } from 'react-native-elements';
import LinearGradient from 'react-native-linear-gradient';

...

<Button
ViewComponent={LinearGradient} // Don't forget this!
linearGradientProps={{
colors: ['red', 'pink'],
start: { x: 0, y: 0.5 },
end: { x: 1, y: 0.5 },
}}
/>

Props

Button

Reference

Button

TouchableComponent

Component for user interaction.

TypeDefault
anyNone

ViewComponent

Component for container.

TypeDefault
React ComponentNone

buttonStyle

Add additional styling for button component.

TypeDefault
View style(Object)None

containerStyle

Styling for Component container.

TypeDefault
View style(Object)None

disabled

If true, disable all interactions for this component.

Disables user interaction.

TypeDefault
booleanfalse

disabledStyle

Style of the button when disabled.

TypeDefault
View style(Object)None

disabledTitleStyle

Style of the title when disabled.

TypeDefault
Text Style(Object)None

icon

Displays a centered icon (when no title) or to the left (with text). (can be used along with iconRight as well). Can be an object or a custom component.

TypeDefault
anyNone

iconContainerStyle

Styling for Icon Component container.

TypeDefault
View style(Object)None

iconPosition

Displays Icon to the position mentioned. Needs to be used along with icon prop.

TypeDefault
"left" or "right" or "top" or "bottom"left

iconRight

Displays Icon to the right of title. Needs to be used along with icon prop.

TypeDefault
booleanfalse

linearGradientProps

Displays a linear gradient. See usage.

TypeDefault
objectNone

loading

Prop to display a loading spinner.

TypeDefault
booleanfalse

loadingProps

Add additional props for ActivityIndicator component.

TypeDefault
ActivityIndicatorPropsNone

loadingStyle

Add additional styling for loading component.

TypeDefault
View style(Object)None

raised

Add raised button styling (optional). Has no effect if type="clear".

TypeDefault
booleanfalse

title

Add button title.

TypeDefault
any

titleProps

Add additional props for Text component.

TypeDefault
TextPropsNone

titleStyle

Add additional styling for title component.

TypeDefault
Text Style(Object)None

type

Type of button.

TypeDefault
"solid" or "clear" or "outline"solid