All Projects → Monte9 → React Native Ratings

Monte9 / React Native Ratings

Licence: mit
Tap and Swipe Ratings component for React Native.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Native Ratings

Blazorfluentui
Port of FluentUI/Office Fabric React components and style to Blazor
Stars: ✭ 467 (-18.21%)
Mutual labels:  ui-components
React Spectrum
A collection of libraries and tools that help you build adaptive, accessible, and robust user experiences.
Stars: ✭ 5,876 (+929.07%)
Mutual labels:  ui-components
Flutter ecommerce template
This is an eCommerce minimalist template with a clean and beautiful design for Flutter.
Stars: ✭ 525 (-8.06%)
Mutual labels:  ui-components
React Native Swipe Gestures
4-directional swipe gestures for react-native
Stars: ✭ 471 (-17.51%)
Mutual labels:  gestures
Advance
Physics-based animations for iOS, tvOS, and macOS.
Stars: ✭ 4,445 (+678.46%)
Mutual labels:  gestures
Po Angular
Biblioteca de componentes Angular.
Stars: ✭ 497 (-12.96%)
Mutual labels:  ui-components
Iblocalizable
Localize your views directly in Interface Builder with IBLocalizable
Stars: ✭ 463 (-18.91%)
Mutual labels:  ui-components
Light
🍭 The usual Snackbar, but elegant
Stars: ✭ 542 (-5.08%)
Mutual labels:  ui-components
Snacky
Snacky is a small library to help you adding a Snackbar to your android project.
Stars: ✭ 482 (-15.59%)
Mutual labels:  ui-components
Circlebar
A fun, easy-to-use tab bar navigation controller for iOS.
Stars: ✭ 513 (-10.16%)
Mutual labels:  ui-components
React Multistep
React multistep form component
Stars: ✭ 473 (-17.16%)
Mutual labels:  ui-components
React Use Gesture
👇Bread n butter utility for component-tied mouse/touch gestures in React and Vanilla Javascript.
Stars: ✭ 5,704 (+898.95%)
Mutual labels:  gestures
Merakiui
🚀 ☄️ Beautiful TailwindCSS components that support RTL languages.
Stars: ✭ 496 (-13.13%)
Mutual labels:  ui-components
Ignite Ui
Ignite UI by Infragistics
Stars: ✭ 468 (-18.04%)
Mutual labels:  ui-components
Uiw
⚛️ @uiwjs A high quality UI Toolkit, A Component Library for React 16+.
Stars: ✭ 531 (-7.01%)
Mutual labels:  ui-components
Topcoat
CSS for clean and fast web apps
Stars: ✭ 4,288 (+650.96%)
Mutual labels:  ui-components
Cfnotify
A customizable framework to create draggable views
Stars: ✭ 490 (-14.19%)
Mutual labels:  ui-components
React Chat Elements
Reactjs chat elements chat UI, react chat components
Stars: ✭ 565 (-1.05%)
Mutual labels:  ui-components
Incubator Weex Ui
🏄 A rich interaction, lightweight, high performance UI library based on Weex.
Stars: ✭ 4,793 (+739.4%)
Mutual labels:  ui-components
Toastnotifications
Toast notifications for WPF allows you to create and display rich notifications in WPF applications. It's highly configurable with set of built-in options like positions, behaviours, themes and many others. It's extendable, it gives you possibility to create custom and interactive notifications in simply manner.
Stars: ✭ 507 (-11.21%)
Mutual labels:  ui-components

react-native-ratings

Ratings component for React Native with tap and swipe enabled.

Demo - try it now

Demo gif

Tap Rating

Swipe Rating

Installation

Install the package using yarn or npm:

yarn add react-native-ratings

OR

npm install --save react-native-ratings

Usage

import { Rating, AirbnbRating } from 'react-native-ratings';

const WATER_IMAGE = require('./water.png')

ratingCompleted(rating) {
  console.log("Rating is: " + rating)
}

<AirbnbRating />

<AirbnbRating
  count={11}
  reviews={["Terrible", "Bad", "Meh", "OK", "Good", "Hmm...", "Very Good", "Wow", "Amazing", "Unbelievable", "Jesus"]}
  defaultRating={11}
  size={20}
/>

<Rating
  showRating
  onFinishRating={this.ratingCompleted}
  style={{ paddingVertical: 10 }}
/>

<Rating
  type='heart'
  ratingCount={3}
  imageSize={60}
  showRating
  onFinishRating={this.ratingCompleted}
/>

<Rating
  type='custom'
  ratingImage={WATER_IMAGE}
  ratingColor='#3498db'
  ratingBackgroundColor='#c8c7c8'
  ratingCount={10}
  imageSize={30}
  onFinishRating={this.ratingCompleted}
  style={{ paddingVertical: 10 }}
/>

Also refer to the example app for more detailed usage example.

API

AirbnbRating

prop default type description
defaultRating 3 number Initial value for the rating
reviews ['Terrible', 'Bad', 'Okay', 'Good', 'Great'] string[] Labels to show when each value is tapped e.g. If the first star is tapped, then value in index 0 will be used as the label
count 5 number Total number of ratings to display
selectedColor #f1c40f string (color) Pass in a custom fill-color for the rating icon
unSelectedColor #BDC3C7 string (color) Pass in a custom not fill-color for the rating icon
reviewColor #f1c40f string (color) Pass in a custom text color for the review text
size 40 number The size of each rating image (optional)
reviewSize 25 number Pass in a custom font size for the review text
showRating true boolean Determines if to show the reviews above the rating
isDisabled false boolean Whether the rating can be modiefied by the user
onFinishRating none function(value: number) Callback method when the user finishes rating. Gives you the final rating value as a whole number
starContainerStyle none object or stylesheet Custom styles applied to the star container

RatingProps

prop default type description
type star string Choose one of the built-in types: star, rocket, bell, heart or use type custom to render a custom image (optional)
ratingImage star string Pass in a custom image source; use this along with type='custom' prop above (optional)
ratingColor #f1c40f string (color) Pass in a custom fill-color for the rating icon; use this along with type='custom' prop above (optional)
ratingBackgroundColor white string (color) Pass in a custom background-fill-color for the rating icon; use this along with type='custom' prop above (optional)
tintColor none string Color used to change the background of the rating icon (optional)
ratingCount 5 number The number of rating images to display (optional)
ratingTextColor none string Color used for the text labels
imageSize 50 number The size of each rating image (optional)
showRating none boolean Displays the Built-in Rating UI to show the rating value in real-time (optional)
readonly false boolean Whether the rating can be modiefied by the user
startingValue ratingCount/2 number The initial rating to render
fractions 2 number The number of decimal places for the rating value; must be between 0 and 20
minValue 0 number The minimum value the user can select
style none style Exposes style prop to add additonal styling to the container view (optional)
onStartRating none function Callback method when the user starts rating
onFinishRating none function(rating: number) Callback method when the user finishes rating. Gives you the final rating value as a whole number (required)

Try it out

You can try it out with Expo here. Or you can also run the example app locally.

Motivation

One of my friends showed me this Star Rating feature in Bootstrap and it looks really interesting. So I challenged myself to re-implement it in React Native.

Followed by that, for v3, I recreated the Airbnb ratings component and added it to this repo, in case others find this useful. It works out of the box and is quite functional.

Also this is my first npm module 🎊

Feedback

This repo is being actively manitained. Feel free to open a new Issue with a Feature Request or submit a PR with an Enhancement.

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].