Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
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 (negative) or decrement (positive). |
initialRate | number | undefined | Initial rate value. |
empty | string or object or array | Style.empty | 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). |
full | string or object or array | Style.full | 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. |
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. |
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 22,117 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.