Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-stars-rating

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-stars-rating

react-native stars rating component

  • 0.1.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-native-stars-rating

This is a simple rating component for react-native.

Dependencies

  1. react-native-vector-icons
  2. class-autobind

Installation

$ npm install react-native-stars-rating --save

$ react-native link

Usage Example

import Stars from 'react-native-stars-rating';

<Stars
  isActive={true}
  rateMax={5}
  isHalfStarEnabled={false}
  onStarPress={(rating) => console.log(rating)}
  rate={3}
  size={60}
/>

Props

type Props = {
  size?: number;
  color?: number;
  rate: number;
  rateMax: number;
  isActive: boolean;
  onStarPress?: (rating: number) => void;
  isHalfStarEnabled?: boolean;
  rounding: 'up' : 'down';
};

Props Explanation

PropDescriptionDefaultRequired
sizeThe Size of the stars20no
colorDetermine the color of the stars rating#EEB211no
rateShows current rating for the star component to display0 (if not active) or 1 (if active)yes
rateMaxDetermine the maximum stars rating to display5yes
isActiveEnable the stars rating to be clickablefalseyes
onStarPressA function that returns the current active rating number using callbacknullno
isHalfStarEnabledEnable the star rating component to support half ratingfalseno
roundingEnabled rounding logic on rating (3.25 -> 3.5) if using up or vice versadownyes

IOS Showcase

rn-stars-ios

Android Showcase

rn-stars-android

Keywords

FAQs

Package last updated on 06 Sep 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc