Button

Buttons communicate the action that will occur when the user touches them.

Usage

const MyComponent = () => (
  <Button raised onPress={() => console.log('Pressed')}>
    Press me
  </Button>
);

Props

disabled
Type: boolean

Disable the button.

compact
Type: boolean

Use a compact look, useful for flat buttons in a row.

raised
Type: boolean

Add elevation to button, as opposed to default flat appearance.

primary
Type: boolean

Use to primary color from theme.

dark
Type: boolean

Text color of button, a dark button will render light text and vice-versa.

loading
Type: boolean

Whether to show a loading indicator.

icon
Type: IconSource

Name of the icon. Can be a string (name of MaterialIcon), an object of shape { uri: 'https://path.to' }, a local image: require('../path/to/image.png'), or a valid React Native component.

color
Type: string

Custom text color for flat button, or background color for raised button.

children (required)
Type: string | Array<string>

Label text of the button.

onPress
Type: Function

Function to execute on press.

style
Type: any
theme
Type: Theme