Search code examples
javascriptreact-nativeradio-buttonreact-native-paper

How to switch radio button and title in react native paper radio button


i use react native paper radio button but it shows the text on the left and the radio button on the right like: "Text ✓", i want the button to be on the left and the text on the right i want it to be: "✓ Text"

enter image description here

this is my code below

                  <RadioButton.Group
                    onValueChange={handleChange('i_am')}
                    value={values.i_am}
                  >
                    <RadioButton.Item
                      label="1"
                      value="1"
                      color="#1E6DAD"
                    />
                    <RadioButton.Item
                      label="2"
                      value="2"
                      color="#1E6DAD"
                    />
                  </RadioButton.Group>

Solution

  • The solution is by using flexDirection =>

                        <RadioButton.Item
                          label="1"
                          value="1"
                          color="#1E6DAD"
                          style={{ flexDirection: 'row-reverse', alignSelf: 'flex-start' }}
                        />