Rating Stars
Accessible tap-to-rate star component supporting custom sizes, ratings, and read-only display.
v0.2.1NativeWindStyleSheetiOSAndroidExpo GoWeb
Preview
Installation
npx nativra-cli add rating-starsWrites RatingStars.tsx to components/ui, rewrites imports to your aliases and records hashes in nativra.lock.json, along with 1 registry dependency. Existing files are never overwritten without asking.
Want to try it first? Open it in the playground: a real React Native project in your browser, with this item installed by the CLI.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| rating | number | 5 | Current rating value between 1 and 5 |
| maxStars | number | 5 | Total number of stars rendered |
| size | "sm" | "md" | "lg" | "md" | Star icon size preset |
| readOnly | boolean | false | Prevents user interaction when used as static score display |
| onRatingChange | (rating: number) => void | undefined | Callback triggered when a star is pressed |
Source
Exactly what the CLI writes, before your import aliases are applied.