Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
react-native-star-rating-widget
Advanced tools
Readme
A customizable, animated star rating component for React Native. Compatible with iOS, Android and Web. Written in Typescript.
npm install react-native-star-rating-widget --save
or yarn add react-native-star-rating-widget
This package exports an
StarRating
componentimport StarRating from 'react-native-star-rating-widget';
const Example = () => {
const [rating, setRating] = useState(0);
return (
<StarRating
rating={rating}
onChange={setRating}
/>
);
};
StarRatingDisplay
componentimport { StarRatingDisplay } from 'react-native-star-rating-widget';
const Example = () => {
return (
<StarRatingDisplay
rating={4.5}
/>
);
};
StarRating
PropsName | Type | Default | Description |
---|---|---|---|
rating | number | REQUIRED | Rating Value. Should be between 0 and maxStars |
onChange | (number) => void | REQUIRED | called when rating changes |
maxStars | number | 5 | number of stars |
starSize | number | 32 | star size |
color | string | "#fdd835" | star color |
emptyColor | string | same as color | empty star color |
style | object | undefined | optional style |
starStyle | object | undefined | optional star style |
enableHalfStar | boolean | true | enable or disable display of half stars |
enableSwiping | boolean | true | enable or disable swiping |
onRatingStart | () => void | undefined | called when user starts interaction |
onRatingEnd | () => void | undefined | called when user ends interaction |
animationConfig | see AnimationConfig | see AnimationConfig | animation configuration object |
StarIconComponent | (props: { size: number; color: string; type: "full" | "half" | "empty"; }) => JSX.Element | StarIcon | Icon component |
StarRatingDisplay
PropsThe StarRatingDisplay
component accepts the same props as StarRating
except onChange
, enableSwiping
, onRatingStart
, onRatingEnd
and animationConfig
.
Name | Type | Default | Description |
---|---|---|---|
scale | number | 1.2 | star animation scale value |
duration | number | 300 | animation duration |
delay | number | 300 | animation delay when interaction has ended |
easing | (number) => number | Easing.elastic(2) | animation easing function |
FAQs
A star rating widget for react native
The npm package react-native-star-rating-widget receives a total of 5,011 weekly downloads. As such, react-native-star-rating-widget popularity was classified as popular.
We found that react-native-star-rating-widget 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
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.