Ben Borgers / Posts /

How to right-align an element in React Native

January 24, 2021 by @benborgers

Right aligning a component can be hard in React Native, especially when you don't want to just use text-align: right.

Luckily, you can use flexbox to right-align an element by setting two properties on a wrapping View.

export default () => {
  return (
        flexDirection: "row",
        justifyContent: "flex-end"
        title="Click me"
        onPress={() => console.log("clicked")}

A quick favor: was anything I wrote incorrect or misspelled, or do you still have questions? Please use this form to let me know or ask for help!