All Projects → djchie → React Native Star Rating

djchie / React Native Star Rating

A React Native component for generating and displaying interactive star ratings

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Native Star Rating

Yii2 Widget Rating
A Yii2 widget for the simple yet powerful bootstrap-star-rating plugin with fractional rating support (sub repo split from yii2-widgets)
Stars: ✭ 47 (-93.51%)
Mutual labels:  star, rating
Android Ratingreviews
Simple star rating system bars, a view similar to the ones seen on Google Playstore. ⭐🌟✨
Stars: ✭ 110 (-84.81%)
Mutual labels:  star, rating
Laravel Reactions
Laravel reactions package for implementing reactions (eg: like, dislike, love, emotion, etc) on Eloquent models.
Stars: ✭ 58 (-91.99%)
Mutual labels:  star, rating
Laravel Love
Add Social Reactions to Laravel Eloquent Models. It lets people express how they feel about the content. Fully customizable Weighted Reaction System & Reaction Type System with Like, Dislike and any other custom emotion types. Do you react?
Stars: ✭ 822 (+13.54%)
Mutual labels:  star, rating
React Native Hero
🤘 A super duper easy hero unit react-native component with support for dynamic image, dynamic sizing, color overlays, and more
Stars: ✭ 234 (-67.68%)
Mutual labels:  component, react-native-component
Bootstrap Star Rating
A simple yet powerful JQuery star rating plugin with fractional rating support.
Stars: ✭ 985 (+36.05%)
Mutual labels:  star, rating
Starrate
swift电商五星评价,星星评分控件,支持自定义数量、拖拽、间隔、设置最小星星数等操作
Stars: ✭ 85 (-88.26%)
Mutual labels:  star, rating
Awesomstar
Awesome (star)rating system with PHP, MySQL and pure JavaScript.
Stars: ✭ 15 (-97.93%)
Mutual labels:  star, rating
React Native Hide Show Password Input
React-Native Hide Show Password InputText Component
Stars: ✭ 50 (-93.09%)
Mutual labels:  component, react-native-component
Raty
🌟 Raty - A Star Rating Plugin
Stars: ✭ 2,292 (+216.57%)
Mutual labels:  star, rating
Mgstarratingview
MGStarRatingView is a view for rating.
Stars: ✭ 70 (-90.33%)
Mutual labels:  star, rating
react-star-ratings
A customizable svg star rating component for selecting x stars or visualizing x stars
Stars: ✭ 128 (-82.32%)
Mutual labels:  rating, star
Rateit.js
Rating plugin for jQuery. Fast, Progressive enhancement, touch support, icon-font support, highly customizable, unobtrusive JavaScript (using HTML5 data-* attributes), RTL support, supports as many stars as you'd like, and also any step size.
Stars: ✭ 146 (-79.83%)
Mutual labels:  star, rating
rater-js
Star rating widget for the browser. Unlimited number of stars. No dependencies. No Jquery required.
Stars: ✭ 66 (-90.88%)
Mutual labels:  rating, star
Andratingbar
A RatingBar library for android, you can customize size ,color ,spacing and image easily!Support right to left。效果可以参看:https://juejin.im/post/6844904143220391949
Stars: ✭ 582 (-19.61%)
Mutual labels:  star, rating
Expanding Collection
ExpandingCollection is an animated material design UI card peek/pop controller. iOS library made by @Ramotion
Stars: ✭ 5,456 (+653.59%)
Mutual labels:  component
Insignia
🔖 Customizable tag input. Progressive. No non-sense!
Stars: ✭ 665 (-8.15%)
Mutual labels:  component
Vue Tabs Component
An easy way to display tabs with Vue
Stars: ✭ 616 (-14.92%)
Mutual labels:  component
React Native Snackbar
🍱 Material Design "Snackbar" component for Android and iOS.
Stars: ✭ 613 (-15.33%)
Mutual labels:  component
React Native Sortable List
React Native Sortable List component
Stars: ✭ 678 (-6.35%)
Mutual labels:  react-native-component

npm version

NPM

React Native Star Rating Component

A React Native component for generating and displaying interactive star ratings. Compatible with both iOS and Android.

Table of Contents

  1. Installation
  2. Usage
  3. Props
  4. General Star Example
  5. Custom Star Example
  6. Roadmap
  7. Contributing

Installation

  1. install react-native-star-rating and its dependeices
npm install react-native-star-rating --save

or

yarn add react-native-star-rating
  1. link react-native-vector-icons
    please refer to react-native-vector-icons installation guide

Usage

Props

Prop Type Description Required Default
activeOpacity number Number between 0 a 1 to determine the opacity of the button. No 0.2
animation string Add an animation to the stars when upon selection. Refer to react-native-animatable for the different animation types. No undefined
buttonStyle ViewPropTypes.style Style of the button containing the star. No {}
containerStyle ViewPropTypes.style Style of the element containing the star rating component. No {}
disabled bool Sets the interactivity of the star buttons. No false
emptyStar string or image object The name of the icon to represent an empty star. Refer to react-native-vector-icons. Also can be a image object, both {uri:xxx.xxx} and require('xx/xx/xx.xxx'). No star-o
emptyStarColor string Color of an empty star. No gray
fullStar string or image object The name of the icon to represent a full star. Refer to react-native-vector-icons. Also can be a image object, both {uri:xxx.xxx} and require('xx/xx/xx.xxx'). No star
fullStarColor string Color of a filled star. No black
halfStar string or image object The name of the icon to represent an half star. Refer to react-native-vector-icons. Also can be a image object, both {uri:xxx.xxx} and require('xx/xx/xx.xxx'). No star-half-o
halfStarColor string Color of a half-filled star. Defaults to fullStarColor. No undefined
halfStarEnabled bool Sets ability to select half stars No false
iconSet string The name of the icon set the star image belongs to. Refer to react-native-vector-icons. No FontAwesome
maxStars number The maximum number of stars possible. No 5
rating number The current rating to show. No 0
reversed bool Renders stars from right to left No false
selectedStar function A function to handle star button presses. Yes () => {}
starSize number Size of the star. No 40
starStyle ViewPropTypes.style Style to apply to the star. No {}

For the emptyStar, fullStar, halfStar, and iconSet props, please refer to the react-native-vector-icons package for the valid string names for the star icons. When selecting the icon string names, you must remember to remove the font family name before the first hyphen. For example, if you want to use the ion-ios-star from the Ionicon font set, you would set the fullStar prop to ios-star and the iconSet to Ionicons.

For the animation prop, please refer to the react-native-animatable package for valid string names for the different animations available.

General Star Example

The following example will render 3.5 stars out of 5 stars using the star-o for the empty star icon, star-half-o for the half star icon, and star for the full star icon from the FontAwesome icon set in black color.

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

class GeneralStarExample extends Component {

  constructor(props) {
    super(props);
    this.state = {
      starCount: 3.5
    };
  }

  onStarRatingPress(rating) {
    this.setState({
      starCount: rating
    });
  }

  render() {
    return (
      <StarRating
        disabled={false}
        maxStars={5}
        rating={this.state.starCount}
        selectedStar={(rating) => this.onStarRatingPress(rating)}
      />
    );
  }
}

export default GeneralStarExample

General Star Example

Custom Star Case

The following example will render 2.5 stars out of 7 stars using the ios-star-outline for the empty star icon, ios-star-half for the half star icon, and ios-star for the full star icon from the Ionicons icon set in red color.

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

class CustomStarExample extends Component {

  constructor(props) {
    super(props);
    this.state = {
      starCount: 2.5
    };
  }

  onStarRatingPress(rating) {
    this.setState({
      starCount: rating
    });
  }

  render() {
    return (
      <StarRating
        disabled={false}
        emptyStar={'ios-star-outline'}
        fullStar={'ios-star'}
        halfStar={'ios-star-half'}
        iconSet={'Ionicons'}
        maxStars={7}
        rating={this.state.starCount}
        selectedStar={(rating) => this.onStarRatingPress(rating)}
        fullStarColor={'red'}
      />
    );
  }
}

export default CustomStarExample

Custom Star Example

Running the ExampleApp (WIP)

Navigate to the root of the ExampleApp and install the dependencies

cd ExampleApp && npm install

Run the app on the iOS simulator.

npm run ios

Development Setup (WIP)

Be sure to have create-react-native-app installed.

npm install -g create-react-native-app

Create a development app in the root folder.

create-react-native-app DevelopmentApp

Going into the development app and clone this repo.

cd DevelopmentApp && git clone https://github.com/djchie/react-native-star-rating.git

Go into the react-native-star-rating directory and start developing!

cd react-native-star-rating

Roadmap

View the project roadmap here

Contributing

See CONTRIBUTING.md for contribution guidelines.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].