|
1 | 1 | # Star-Ratings
|
2 | 2 |
|
| 3 | +[](https://www.npmjs.com/package/@triniwiz/nativescript-star-ratings) |
| 4 | +[](https://www.npmjs.com/package/@triniwiz/nativescript-star-ratings) |
| 5 | + |
3 | 6 | | Android Device | Android Emulator | iOS Device | iOS Simulator |
|
4 | 7 | | :-------------: |:-------------: |:-------------:| :-----: |
|
5 |
| -| :white_check_mark:|:white_check_mark: |:white_check_mark:| :negative_squared_cross_mark:| |
| 8 | +| :white_check_mark:|:white_check_mark: |:white_check_mark:| :white_check_mark:| |
6 | 9 |
|
7 | 10 |
|
8 | 11 | ## Installing
|
9 | 12 |
|
10 | 13 | ```base
|
11 | 14 | ns plugin add @triniwiz/nativescript-star-ratings
|
12 |
| -``` |
| 15 | +``` |
| 16 | + |
| 17 | +# Configuration |
| 18 | + |
| 19 | +### Core |
| 20 | + |
| 21 | +::: tip IMPORTANT |
| 22 | +Ensure you've included `xmlns:ui="@triniwiz/nativescript-star-ratings"` on the |
| 23 | +Page element |
| 24 | +::: |
| 25 | + |
| 26 | +```xml |
| 27 | +<ui:StarRating emptyBorderColor="white" emptyColor="white" filledBorderColor="black" filledColor="red" value="2" max="5"/> |
| 28 | +``` |
| 29 | + |
| 30 | +### Angular |
| 31 | + |
| 32 | +```ts |
| 33 | +import { registerElement } from '@nativescript/angular/element-registry'; |
| 34 | +registerElement('StarRating', () => require('@triniwiz/nativescript-star-ratings').StarRating); |
| 35 | +``` |
| 36 | + |
| 37 | +### Vue |
| 38 | + |
| 39 | +```ts |
| 40 | +import { registerElement } from "nativescript-vue'"; |
| 41 | +registerElement('StarRating', () => require('@triniwiz/nativescript-star-ratings').StarRating); |
| 42 | +``` |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | +### React |
| 47 | + |
| 48 | +```ts |
| 49 | +import { registerElement } from "react-nativescript"; |
| 50 | +registerElement('StarRating', () => require('@triniwiz/nativescript-star-ratings').StarRating); |
| 51 | +``` |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +### Svelte |
| 56 | + |
| 57 | +```ts |
| 58 | +import { registerNativeViewElement } from 'svelte-native/dom'; |
| 59 | +registerNativeViewElement('StarRating', () => require('@triniwiz/nativescript-star-ratings').StarRating); |
| 60 | +``` |
| 61 | + |
| 62 | +```html |
| 63 | +<StarRating emptyBorderColor="white" emptyColor="white" filledBorderColor="black" filledColor="red" value="{{value}}" max="{{max}}" isindicator="false"></StarRating> |
| 64 | +``` |
| 65 | + |
| 66 | + |
| 67 | +## API |
| 68 | + |
| 69 | +| Property | Default | Type | iOS | Android | |
| 70 | +| :-------------:|:-------------: |:-------------:| :-----:| :-----:| |
| 71 | +| emptyBorderColor |blue | string | :white_check_mark: | :x: | |
| 72 | +| emptyColor |white | string | :white_check_mark: | :white_check_mark: | |
| 73 | +| filledBorderColor |blue | string | :white_check_mark: | :x: | |
| 74 | +| filledColor |white | string | :white_check_mark: | :white_check_mark: | |
| 75 | +| value |0 | number | :white_check_mark: | :white_check_mark: | |
| 76 | +| max |5 | number | :white_check_mark: | :white_check_mark: | |
| 77 | +| isindicator |false | false | :x: | :white_check_mark: | |
0 commit comments