v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS
Rating
A named rating with native radio semantics.
Interactive preview
Usage
import { Rating } from "@devvy-ui/react";
<Rating label="Your rating" name="rating" max={5} />API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| max | number | 5 | Number of choices, 1–10. |
| value / defaultValue | number | — | Selected rating. |
| onValueChange | (rating: number) => void | — | Selection callback. |
Accessibility & behavior
Platform Behavior & Guidelines
RadioGroup composition retains native arrow keys, form/reset, required and disabled behavior. Stars also have readable numeric labels.
Source ownership
Run npx @devvy-ui/cli init once in your React project, then add the source:
npx @devvy-ui/cli add ratingMake the source yours.
Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.
Rating.tsxREACT / TSX
Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.