
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
react-rating
Advanced tools
React Rating is a react rating component which supports custom symbols both with inline styles and glyphicons found in popular CSS Toolkits like Fontawesome or Bootstrap.
I intend to port the jQuery bootstrap-rating to a React component.
See react-rating in action.
You can install react-rating
component using the npm package manager:
npm install --save react-rating
The react-rating
component peer depends on the React library.
You can install React using npm too:
npm install --save react
Require the Rating Component
var Rating = require('react-rating');
Start using it
With raw javascript:
React.createElement(Rating)
Or with JSX:
<Rating />
Property | Type | Default | Description |
---|---|---|---|
start | number | 0 | Range starting value (exclusive). |
stop | number | 5 | Range stop value (inclusive). |
step | number | 1 | Step increment (positive) or decrement (negative). |
placeholderRate | number | undefined | Placeholder rate value. |
initialRate | number | undefined | Initial rate value. |
empty | element or object or string or array | Style.empty | React element, inline style object, or classes applied to the rating symbols when empty. Or an array of such symbols that will be applied in a circular manner (round-robin). |
placeholder | element or object or string or array | Style.full | React element, inline style object, or classes applied to the rating symbols in HTML input placeholder fashion. Or an array of such symbols that will be applied in a circular manner (round-robin). |
full | element or object or string or array | Style.full | React element, inline style object, or classes applied to the rating symbols when full. Or an array of such symbols that will be applied in a circular manner (round-robin). |
readonly | bool | false | Whether the rating can be modified or not. |
quiet | bool | false | Whether to animate rate hovering or not. |
fractions | number | 1 | Number of equal parts that make up a whole symbol. |
Callback | Type | Description |
---|---|---|
onChange | function (rate) {} | Called when the selected rate is changed. |
onClick | function (rate) {} | Called when a rate is clicked. |
onRate | function (rate) {} | Called when a rate is entered or left. When a rate is left it is called with undefined . |
FAQs
A rating react component with custom symbols
The npm package react-rating receives a total of 41,417 weekly downloads. As such, react-rating popularity was classified as popular.
We found that react-rating demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.