Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-ts-rating-star
Advanced tools
Readme
React TS Rating Star allows you to create a customizable rating star component with ease.
Requirements:
React >= 16.8.0
Installation:
On the command line navigate to the project root and enter:
npm install react-ts-rating-star
yarn add react-ts-rating-star
TSX:
import { RatingStar } from 'react-ts-rating-star'
// ...
<RatingStar />
Prop name | Type | Default | Optional | Description |
---|---|---|---|---|
numberOfStars | number | 5 | true | The number of stars to display. |
averageRating | number | true | The rate displayed before interacting with the component. | |
iconColor | string | 'gold' | true | The color of the icons when active. |
backgroundColor | string | 'darkgray' | true | The background color of the icons (inactive icon.) |
iconWidth | string | '2em' | true | The width of the icons. |
iconHeight | string | '2em' | true | The height of the icons. |
iconHoverEffect | HoverEffect | 'none' | true | The effect on hover (see HoverEffect type below). |
onClick | (rating: number) => unknown | true | Function called when the user clicks on a star. |
Possible values of iconHoverEffect are the following:
'none'
'scaling'
'twinkling'
'rotating'
'animated-scaling'
'animated-twinkling'
'animated-rotating'
import React from 'react'
import { RatingStar } from 'react-ts-rating-star'
import MyCustomIcon from './MyCustomIcon.tsx'
const ExampleRatingStar = () => {
const getStarNumberClicked = (rating: number) => {
console.log(`Rating: ${rating}`)
}
return (
<RatingStar
iconColor='#fdcb6e'
backgroundColor='#dfe6e9'
iconWidth='4em'
iconHeight='4em'
averageRating={3.81}
iconHoverEffect='scaling'
onClick={getStarNumberClicked}
/>
)
}
export default ExampleRatingStar
FAQs
React TS Rating Star allows you to create a customizable rating star component with ease.
The npm package react-ts-rating-star receives a total of 9 weekly downloads. As such, react-ts-rating-star popularity was classified as not popular.
We found that react-ts-rating-star demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.