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.
<Button title="Solid Button" />
Usage
- Solid
- Clear
- Outline
Solid Button
Clear Button
Outline Button
Button with icon
Loading...
Button with right icon
Loading...
Button with loading spinner
Loading...
Props
note
Includes all TouchableOpacity props.
Name | Type | Default | Description |
---|---|---|---|
TouchableComponent | typeof Component | Component for user interaction. | |
ViewComponent | React Component | Component for container. | |
buttonStyle | View Style | Add additional styling for button component. | |
containerStyle | View Style | Styling for Component container. | |
disabled | boolean | false | Disables user interaction. |
disabledStyle | View Style | Style of the button when disabled. | |
disabledTitleStyle | Text Style | Style of the title when disabled. | |
icon | IconNode | 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. | |
iconContainerStyle | View Style | Styling for Icon Component container. | |
iconPosition | left or right or top or bottom | left | Displays Icon to the position mentioned. Needs to be used along with icon prop. |
iconRight | boolean | false | Displays Icon to the right of title. Needs to be used along with icon prop. |
linearGradientProps | object | Displays a linear gradient. | |
loading | boolean | false | Prop to display a loading spinner. |
loadingProps | ActivityIndicatorProps | Add additional props for ActivityIndicator component. | |
loadingStyle | View Style | Add additional styling for loading component. | |
raised | boolean | false | Add raised button styling (optional). Has no effect if type="clear" . |
title | string or ReactElement<{}, string or JSXElementConstructor<any>> | Add button title. | |
titleProps | TextProps | Add additional props for Text component. | |
titleStyle | Text Style | Add additional styling for title component. | |
type | solid or clear or outline | solid | Type of button. |