0.0.7 • Published 10 months ago

@hammim-in/react-native-ratings v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

React Native Ratings

Supports React 19

A customizable, simple star-based rating component for React Native.
Lightweight and easy to integrate into your app for collecting user ratings.


✨ Features

  • 🌟 Interactive star ratings
  • 🎨 Customizable star size and colors
  • 📝 Optional labels for each rating level
  • 🚫 Disable interaction mode
  • ⚡ Zero dependency other than React Native
  • 🧠 Written fully in TypeScript

📦 Installation

npm install @hammim-in/react-native-ratings
# or
yarn add @hammim-in/react-native-ratings



## Usage

```javascript
import { Ratings } from '@hammim-in/react-native-ratings';

function MyComponent() {
  return (
    <Ratings
      rating={3}
      size={32}
      maxStars={5}
      showRating={true}
      labels={['Bad', 'Okay', 'Good', 'Very Good', 'Excellent']}
      onRate={(value) => console.log('Rated:', value)}
    />
  );
}

🛠️ Props

Prop NameTypeRequiredDescription
ratingnumber✅ YesThe current rating value
maxStarsnumber❌ NoMaximum number of stars (default: 5)
sizenumber❌ NoSize (width/height) of each star (default: 24)
labelsstring[]❌ NoArray of labels to show based on the rating
showRatingboolean❌ NoWhether to show label text below stars (default: false)
onRate(value: number) => void❌ NoCallback triggered when a star is selected
isDisabledboolean❌ NoDisable rating interaction (default: false)

🎨 Customization

Easily style and configure the component:

  • Choose star size and spacing
  • Use your own star images (defaults included)
  • Customize the number of stars
  • Toggle label visibility
  • Disable interaction when needed
  • Customize label text for each rating level

🧩 Types

interface RatingProps {
  rating: number;
  maxStars?: number;
  size?: number;
  showRating?: boolean;
  labels?: string[];
  onRate?: (rating: number) => void;
  isDisabled?: boolean;
}

📄 License

MIT License © 2025 Ham Mim

🙌 Support

If you find any issues or have a feature request, feel free to open an issue.

Or contact: support@hammim.in

🚧 Future Improvements (Coming Soon)

  • Customizable debounce delay
  • Add current location ("Use my location") button
  • Styling props for better theming
  • Support reverse geocoding
  • Localization for different languages
0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago