Skip to content

Commit 16528c6

Browse files
committed
feat(star-ratings): StarRatings v2
1 parent 45c0a9f commit 16528c6

File tree

3 files changed

+89
-9
lines changed

3 files changed

+89
-9
lines changed
Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,77 @@
11
# Star-Ratings
22

3+
[![npm](https://img.shields.io/npm/v/@triniwiz/nativescript-star-ratings.svg)](https://www.npmjs.com/package/@triniwiz/nativescript-star-ratings)
4+
[![npm](https://img.shields.io/npm/dt/@triniwiz/nativescript-star-ratings.svg?label=npm%20downloads)](https://www.npmjs.com/package/@triniwiz/nativescript-star-ratings)
5+
36
| Android Device | Android Emulator | iOS Device | iOS Simulator |
47
| :-------------: |:-------------: |:-------------:| :-----: |
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:|
69

710

811
## Installing
912

1013
```base
1114
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: |

packages/nativescript-star-ratings/README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
ns plugin add @triniwiz/nativescript-star-ratings
55
```
66

7-
## Usage
87

9-
// TODO
8+
## API documentation
9+
10+
[Documentation for the latest stable release](https://triniwiz.github.io/nativescript-plugins/api-reference/star-ratings.html)
11+
12+
1013

1114
## License
1215

packages/nativescript-star-ratings/package.json

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@triniwiz/nativescript-star-ratings",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "NativeScript star ratings UI component plugin.",
55
"main": "index",
66
"typings": "index.d.ts",
@@ -12,7 +12,7 @@
1212
},
1313
"repository": {
1414
"type": "git",
15-
"url": "https://github.com/triniwiz/plugins.git"
15+
"url": "https://github.com/triniwiz/nativescript-plugins.git"
1616
},
1717
"keywords": [
1818
"NativeScript",
@@ -25,11 +25,23 @@
2525
"name": "Osei Fortune",
2626
"email": "[email protected]"
2727
},
28+
"contributors": [
29+
{
30+
"name": "Sean Perkins",
31+
"email": "[email protected]",
32+
"url": "https://github.com/sean-perkins"
33+
},
34+
{
35+
"name": "Yeshwanth Alampalli",
36+
"email": "[email protected]",
37+
"url": "https://github.com/Alampalli-Yeshwanth"
38+
}
39+
],
2840
"bugs": {
29-
"url": "https://github.com/triniwiz/plugins/issues"
41+
"url": "https://github.com/triniwiz/nativescript-plugins/issues"
3042
},
3143
"license": "Apache-2.0",
32-
"homepage": "https://github.com/triniwiz/plugins",
44+
"homepage": "https://github.com/triniwiz/nativescript-plugins",
3345
"readmeFilename": "README.md",
3446
"bootstrapper": "@nativescript/plugin-seed"
35-
}
47+
}

0 commit comments

Comments
 (0)