Search code examples
react-nativebuttonreact-native-elements

How to align button's title to right using react-native-elements?


I am using react-native-elements to add button in my app, but i am unable to align the text inside the button to right.

I tried titleStyle property with alignText:'right' but with no success

<Button title={'Hello World'} titleStyle={{ textAlign:'right' }} />

I wanted the button title to align to the right but it just stays in the center.


Solution

  • You can easily do this by adding justifyContent 'flex-end' to React Native Elements Button buttonStyle props

    <Button
      title="My Button"
      type="clear"
      buttonStyle={{ justifyContent: 'flex-end' }}
    />