Socket
Socket
Sign inDemoInstall

react-native-ratings

Package Overview
Dependencies
Maintainers
3
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-ratings

The standard Ratings component for React Native


Version published
Weekly downloads
199K
increased by6.22%
Maintainers
3
Weekly downloads
 
Created

What is react-native-ratings?

The react-native-ratings package is a React Native component for adding customizable rating elements to your application. It supports star ratings, tap ratings, and swipe ratings, making it versatile for various use cases where user feedback is required.

What are react-native-ratings's main functionalities?

Star Rating

This feature allows you to create a star-based rating system. Users can rate by selecting the number of stars. The `onFinishRating` callback provides the selected rating value.

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

const StarRatingComponent = () => (
  <Rating
    type='star'
    ratingCount={5}
    imageSize={30}
    onFinishRating={(rating) => console.log('Rating is: ' + rating)}
  />
);

Tap Rating

This feature provides a tap-based rating system similar to the one used by Airbnb. Users can tap on a rating and see a corresponding review label. The `onFinishRating` callback provides the selected rating value.

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

const TapRatingComponent = () => (
  <AirbnbRating
    count={5}
    reviews={['Terrible', 'Bad', 'Okay', 'Good', 'Great']}
    defaultRating={3}
    size={20}
    onFinishRating={(rating) => console.log('Rating is: ' + rating)}
  />
);

Swipe Rating

This feature allows for a swipe-based rating system with customizable images and colors. Users can swipe to select their rating. The `onFinishRating` callback provides the selected rating value.

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

const SwipeRatingComponent = () => (
  <Rating
    type='custom'
    ratingImage={require('./path/to/custom/image.png')}
    ratingColor='#3498db'
    ratingBackgroundColor='#c8c7c8'
    ratingCount={10}
    imageSize={30}
    onFinishRating={(rating) => console.log('Rating is: ' + rating)}
    style={{ paddingVertical: 10 }}
  />
);

Other packages similar to react-native-ratings

Keywords

FAQs

Package last updated on 23 May 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

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