Socket
Book a DemoInstallSign in
Socket

@empglabs/react-native-star-rating-widget

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@empglabs/react-native-star-rating-widget

A star rating widget for react native

latest
Source
npmnpm
Version
1.0.17
Version published
Maintainers
3
Created
Source

react-native-star-rating-widget

npm version

A customizable, animated star rating component for React Native. Compatible with iOS and Android. Written in Typescript.

Demo

Installation

  • install react-native-star-rating-widget npm install react-native-star-rating-widget --save or yarn add react-native-star-rating-widget
  • if not already installed, add react-native-svg

Usage

import StarRating from 'react-native-star-rating-widget';

const Example = () => {
  const [rating, setRating] = useState(0);
  return (
      <StarRating
        rating={rating}
        onChange={setRating}
      />
  );
};

Props

NameTypeDefaultDescription
ratingnumberREQUIREDRating Value. Should be between 0 and maxStars
onChange(number) => voidREQUIREDcalled when rating changes
maxStarsnumber5number of stars
minRatingnumber0.5minimum selectable rating
starSizenumber32star size
colorstring"#fdd835"star color
emptyColorstringsame as colorempty star color
styleobjectundefinedoptional style
enableHalfStarbooleantrueenable or disable display of half stars
animationConfigsee AnimationConfigsee AnimationConfiganimation configuration object

AnimationConfig

NameTypeDefaultDescription
scalenumber1.2star animation scale value
durationnumber300animation duration
delaynumber300animation delay when interaction has ended
easing(number) => numberEasing.elastic(2)animation easing function

Keywords

react

FAQs

Package last updated on 24 Aug 2021

Did you know?

Socket

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.

Install

Related posts