Components · Interactive
Rating
StableSince v0.0.1
Star rating input, supports controlled and read-only modes.
import { Rating } from '@nexub/react';Examples
Default
Read-only
Sizes
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | — | The controlled rating value. |
| max | number | 5 | Maximum number of stars. |
| readOnly | boolean | false | Prevents user interaction when true. |
| size | 'sm' | 'md' | 'lg' | — | Size of the star icons. |
| onValueChange | (value: number) => void | — | Callback fired when the user selects a new rating. |
On iOS & Android
Web only
Rating has no @nexub/react-native twin. On phones, follow the platform pattern instead, or compose it from the native components listed on the React Native page.