Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nativescript-rtl/ui

Add right-to-left support to the NativeScript framework
https://github.com/nativescript-rtl/ui

android angular core ios left-to-right ltr nativescript nativescript-6 nativescript-plugin right-to-left rtl support vue

Last synced: 1 day ago
JSON representation

Add right-to-left support to the NativeScript framework

Awesome Lists containing this project

README

        

# @nativescript-rtl/ui
Add right-to-left UI support to NativeScript framework

## Installation
to install plugin write:
### NativeScript 7 and higher
```bash
tns plugin add @nativescript-rtl/ui
```

### Support NativeScript older then version 7
```bash
tns plugin add @nativescript-rtl/[email protected]
```

## Preview
| LTR | Layout | RTL |
| :--- | :---: | ---: |
| screenshot 1 | `AbsoluteLayout` | screenshot 1 |
| screenshot 2 | `DockLayout` | screenshot 2 |
| screenshot 3 | `GridLayout` | screenshot 3 |
| screenshot 4 | `StackLayout` | screenshot 4 |
| screenshot 5 | `WrapLayout` | screenshot 5 |

## Properties
| Name | Default | Description |
| :-- | :----- | :--------- |
| isRtl | `true` | `isRtl` use to change layout direction by default is `true` that mean layout from right to left but you can change it to `false` that change layout direction from left to right |

## CSS Properties
| Name | Default | Description |
| :-- | :----- | :--------- |
| direction | `rtl` | use to change layout direction by default is `rtl` that mean layout from right to left but you can change it to `ltr` that change layout to direction from left to right |

## How to use
declare plugin in XML then use it.
```xml






```

For Angular/Vue 'registerElement` must be used to register each RTL element

example:
register elements in `app.module.ts`
```ts
import { registerElement } from "nativescript-angular/element-registry";
registerElement(
"RGridLayout",
() => require("@nativescript-rtl/ui").GridLayout
);
registerElement(
"RWrapLayout",
() => require("@nativescript-rtl/ui").WrapLayout
);
registerElement(
"RAbsoluteLayout",
() => require("@nativescript-rtl/ui").AbsoluteLayout
);
registerElement(
"RDockLayout",
() => require("@nativescript-rtl/ui").DockLayout
);
registerElement(
"RStackLayout",
() => require("@nativescript-rtl/ui").StackLayout
);
```
now you can use `RGridLayout`, `RWrapLayout`, `RAbsoluteLayout`, `RDockLayout` and `RStackLayout` in your angular project

example:
```xml






```