{"id":20979453,"url":"https://github.com/mooalot/star-rating-component","last_synced_at":"2025-08-23T02:09:28.472Z","repository":{"id":57369464,"uuid":"445757225","full_name":"mooalot/star-rating-component","owner":"mooalot","description":"A simple star rating component","archived":false,"fork":false,"pushed_at":"2022-01-09T06:02:08.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-27T08:23:22.176Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mooalot.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-01-08T07:47:00.000Z","updated_at":"2022-01-09T06:02:11.000Z","dependencies_parsed_at":"2022-08-26T06:00:26.909Z","dependency_job_id":null,"html_url":"https://github.com/mooalot/star-rating-component","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooalot%2Fstar-rating-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooalot%2Fstar-rating-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooalot%2Fstar-rating-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mooalot%2Fstar-rating-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mooalot","download_url":"https://codeload.github.com/mooalot/star-rating-component/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243382787,"owners_count":20282008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T05:13:34.155Z","updated_at":"2025-03-13T09:49:24.629Z","avatar_url":"https://github.com/mooalot.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# star-rating\n\n![image](https://drive.google.com/uc?export=view\u0026id=1xSMT5hOSHQPgEMwESSGMnXhQbJvmkiyB)\n\n## Installation \n`npm i star-rating-component`\n\n### Angular\n\nAdd this to your `app.module.ts`\n```typescript\n\nimport { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';\n\n@NgModule({\n  ...\n  schemas: [\n    CUSTOM_ELEMENTS_SCHEMA\n  ]\n  ...\n})\nexport class AppModule { }\n  ```\n\nAdd this to `main.ts`\n```Typescript\nimport { defineCustomElements } from '@igabe/star-rating/loader'\n\ndefineCustomElements(window)\n```\n\n### Other frameworks\n\nThis is just a stencil component, so it can be used in other frameworks.\n\n## Properties\n\n| Property        | Attribute        | Description | Type      | Default |\n| --------------- | ---------------- | ----------- | --------- | ------- |\n| `defaultRating` | `default-rating` | The default rating when the component is loaded            | `number`  | `3`     |\n| `numStars`      | `num-stars`      | The total number of stars           | `number`  | `5`     |\n| `rounded`       | `rounded`        | Gives the stars a more bubbly look            | `boolean` | `true`  |\n\n\nComponent does not allow for zero stars. Good for us, better reviews.\n\n## Events\n\n| Event          | Description | Type               |\n| -------------- | ----------- | ------------------ |\n| `ratingChange` | Emitted when the rating is changed            | `CustomEvent\u003cany\u003e` |\n\n\n\n## Styling\n\nThese css variables can be overridden \n\n```\n    --rating-active-fill-color \n    --rating-inactive-fill-color \n    --rating-active-stroke-color \n    --rating-inactive-stroke-color \n    --rating-star-size \n    --rating-star-spacing \n    --rating-star-shadow-color \n```\n\n## Example\n\n.html\n\n```html\n\u003cstar-rating rounded=\"true\" defaultRating=\"3\" numStars=\"5\" (ratingChange)=\"ratingChange($event)\"\u003e\u003c/star-rating\u003e\n```\n\n.ts\n```Typescript\nratingChange(event) {\n    console.log('New rating: ', event.detail);\n  }\n```\n\n.css\n\n```css\nstar-rating {\n    --rating-active-fill-color: #f5f846;\n    --rating-inactive-fill-color: #d8d8d8;\n    --rating-active-stroke-color: #ffb400;\n    --rating-inactive-stroke-color: #d8d8d8;\n    --rating-star-size: 2rem;\n    --rating-star-spacing: 0.1rem;\n    --rating-star-shadow-color: rgba(0, 0, 0, .7);\n}\n```\n\n\n----------------------------------------------\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmooalot%2Fstar-rating-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmooalot%2Fstar-rating-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmooalot%2Fstar-rating-component/lists"}