react-native-rtl-layout
This component make you easy to handle the RTL layout.
Installation
npm install react-native-rtl-layout
or yarn add react-native-rtl-layout
How to use
... // Import { RTLView, RTLText } from react-native-rtl-layout { superprops thisstate = locale: 'en' } { this } { return <View style= flex: 1 justifyContent: 'center' > <RTLView locale=thisstatelocale> <Text>Lorem ipsum dollar amet</Text> </RTLView> <RTLView locale=thisstatelocale> <RTLText locale=thisstatelocale fontSize=20>This is RTL text component</RTLText> </RTLView> <Button style= margin: 20 onPress=thistoggleLocale title='Toggle locale' /> </View> }
Props
locale
- The locale type of device to handle (en, ar)
fontSize
- Custom font-size for Arabic text RTLText
.
Contributing
This is pretty basic at the moment, but if you have new features, requests, or would like to contribute feel free to open a PR and ping me!