{"id":15416697,"url":"https://github.com/bunlong/react-star","last_synced_at":"2025-04-19T14:33:44.550Z","repository":{"id":57345296,"uuid":"330181517","full_name":"Bunlong/react-star","owner":"Bunlong","description":"A tiny star rating component with custom icons for React.","archived":false,"fork":false,"pushed_at":"2021-04-04T06:27:35.000Z","size":92,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-20T13:26:03.665Z","etag":null,"topics":["rating","react","react-component","react-rating","reactjs","star","star-rating"],"latest_commit_sha":null,"homepage":"https://codesandbox.io/s/react-star-1wexv","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/Bunlong.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":"2021-01-16T14:31:44.000Z","updated_at":"2023-03-15T17:16:11.000Z","dependencies_parsed_at":"2022-09-14T04:20:31.193Z","dependency_job_id":null,"html_url":"https://github.com/Bunlong/react-star","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Freact-star","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Freact-star/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Freact-star/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bunlong%2Freact-star/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bunlong","download_url":"https://codeload.github.com/Bunlong/react-star/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232548610,"owners_count":18540145,"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":["rating","react","react-component","react-rating","reactjs","star","star-rating"],"created_at":"2024-10-01T17:13:27.508Z","updated_at":"2025-01-05T04:57:54.494Z","avatar_url":"https://github.com/Bunlong.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/Bunlong/react-star/main/react-star.png\" alt=\"react-star\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  ⭐️ Please support us by giving a star! Thanks! ⭐️\n\u003c/p\u003e\n\n# react-star\n\nA tiny star rating component with custom icons for React.\n\n\u003c!-- ### 💻 Live [Demo](https://codesandbox.io/s/react-screen-capture-i9f4d) --\u003e\n\n## 🎁 Features\n\n* Easy to use\n* Compatible with both JavaScript and TypeScript\n\n## 🔧 Install\n\nreact-star is available on npm. It can be installed with the following command:\n\n```\nnpm install react-star --save\n```\n\nreact-star is available on yarn as well. It can be installed with the following command:\n\n```\nyarn add react-star\n```\n\n## 💡 Usage\n\n```jsx\nimport React from 'react';\nimport { Star } from 'react-star';\n\nclass App extends React.Component {\n  render() {\n    return (\n      \u003cStar\n        onChange={(value) =\u003e console.log(value)}\n      /\u003e\n    );\n  }\n};\n\nexport default App;\n```\n\n## 📖 APIs\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eProps\u003c/th\u003e\n    \u003cth\u003eType\u003c/th\u003e\n    \u003cth\u003eDefault\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003edefaultValue\u003c/td\u003e\n    \u003ctd\u003enumber\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n    \u003ctd\u003eThe default value. Use when the component is not controlled.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eshape\u003c/td\u003e\n    \u003ctd\u003e'thin' | 'fat'\u003c/td\u003e\n    \u003ctd\u003e'thin'\u003c/td\u003e\n    \u003ctd\u003eThe shape of the star.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003efraction\u003c/td\u003e\n    \u003ctd\u003enumber\u003c/td\u003e\n    \u003ctd\u003e1\u003c/td\u003e\n    \u003ctd\u003eThe number of equal subdivisions that can be selected as a rating in each icon, example, for a fractions value of 2, you will be able to select a rating with a precision of down to half a icon.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ereadOnly\u003c/td\u003e\n    \u003ctd\u003eboolean\u003c/td\u003e\n    \u003ctd\u003efalse\u003c/td\u003e\n    \u003ctd\u003eRemoves all hover effects and pointer events.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003emin\u003c/td\u003e\n    \u003ctd\u003enumber\u003c/td\u003e\n    \u003ctd\u003e0\u003c/td\u003e\n    \u003ctd\u003eMinimum star.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003emax\u003c/td\u003e\n    \u003ctd\u003enumber\u003c/td\u003e\n    \u003ctd\u003e5\u003c/td\u003e\n    \u003ctd\u003eMaximum star.\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## 🔰 Callbacks\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003eCallback\u003c/th\u003e\n    \u003cth\u003eType\u003c/th\u003e\n    \u003cth\u003eDescription\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eonChange\u003c/td\u003e\n    \u003ctd\u003e\u003ccode\u003e(value) =\u003e {}\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eThe onChange props fires the moment when the value of the element is changed.\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eonClick\u003c/td\u003e\n    \u003ctd\u003e\u003ccode\u003e(value) =\u003e {}\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eThe onclick props fires on a mouse click on the element.\u003c/td\u003e\n  \u003c/tr\u003e\n   \u003ctr\u003e\n    \u003ctd\u003eonHover\u003c/td\u003e\n    \u003ctd\u003e\u003ccode\u003e(value) =\u003e {}\u003c/code\u003e\u003c/td\u003e\n    \u003ctd\u003eThe onHover event occurs when the mouse pointer is moved onto an element.\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## ❗ Issues\n\nIf you think any of the `react-star` can be improved, please do open a PR with any updates and submit any issues. Also, I will continue to improve this, so you might want to watch/star this repository to revisit.\n\n## 🌟 Contribution\n\nWe'd love to have your helping hand on contributions to `react-star` by forking and sending a pull request!\n\nYour contributions are heartily ♡ welcome, recognized and appreciated. (✿◠‿◠)\n\nHow to contribute:\n\n- Open pull request with improvements\n- Discuss ideas in issues\n- Spread the word\n- Reach out with any feedback\n\n## ✨ Contributors\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003ca href=\"https://github.com/Bunlong\"\u003e\n        \u003cimg src=\"https://avatars0.githubusercontent.com/u/1308397?s=400\u0026u=945dc6b97571e2b98b659d34b1c81ae2514046bf\u0026v=4\" width=\"100\" alt=\"Bunlong\" /\u003e\n        \u003cbr /\u003e\n        \u003csub\u003e\n          \u003cb\u003eBunlong\u003c/b\u003e\n        \u003c/sub\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## ⚖️ License\n\nThe MIT License [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n\u003c!-- \n\nimport React, { CSSProperties } from 'react';\n\nconst background = {\n  borderRadius: '50%',\n  border: '5px double white',\n  display: 'inline-block',\n  height: 30,\n  width: 30,\n} as CSSProperties;\n\nconst styles = {\n  empty: {\n    ...background,\n    backgroundColor: '#ccc',\n  } as CSSProperties,\n  full: {\n    ...background,\n    backgroundColor: 'black',\n  } as CSSProperties,\n  placeholder: {\n    ...background,\n    backgroundColor: 'red',\n  } as CSSProperties,\n};\n\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbunlong%2Freact-star","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbunlong%2Freact-star","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbunlong%2Freact-star/lists"}