---
id: button
title: Button
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import { Button } from 'react-native-elements';
import Usage from '../component_usage/Button.mdx';

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](http://reactnative.dev/docs/touchablenativefeedback.html#props) (Android) or [TouchableOpacity](http://reactnative.dev/docs/touchableopacity.html#props) (iOS) props.

```jsx
<Button title="Solid Button" />
```

## Usage

<Usage />

<Tabs
  defaultValue="Solid"
  values={[
    {
      label: 'Solid',
      value: 'Solid',
    },
    {
      label: 'Clear',
      value: 'Clear',
    },
    {
      label: 'Outline',
      value: 'Outline',
    },
  ]}
>
  <TabItem value="Solid">
    <Button title="Solid Button" />
  </TabItem>
  <TabItem value="Clear">
    <Button title="Clear Button" type="clear" />
  </TabItem>
  <TabItem value="Outline">
    <Button title="Outline Button" type="outline" />
  </TabItem>
</Tabs>

### Button with icon

```jsx live
<Button title="Solid" type="solid" icon="home" />
```

### Button with right icon

```jsx live
<Button title="Solid" type="solid" icon="home" iconRight />
```

### Button with loading spinner

```jsx live
<Button title="Solid" type="solid" loading />
```

## Props

:::note
Includes all [TouchableOpacity](https://reactnative.dev/docs/touchableopacity#props) props.
:::

<div class='table-responsive'>

| 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.                                                                                                                                          |

</div>
