Rating
uitemplate
Rating: renders a row of star glyphs for a 1-to-N rating
Terminal
$termuijs render rating
Installation
$ bunx termuijs add rating
Copies the source into src/components/rating/ and installs @termuijs/core, @termuijs/widgets.
Usage
ts
import { Rating } from '@termuijs/ui'ts
new Rating(style: Partial<Style> = {}, opts: RatingOptions = {})API Reference
Rating
| Prop | Type | Required | Description |
|---|---|---|---|
max | number | optional | Total number of stars |
value | number | optional | Initial rating |
filledChar | string | optional | Filled star character |
emptyChar | string | optional | Empty star character |
filledColor | Color | optional | Color for filled stars |
onSelect | (value: number) => void | optional | Callback when the user confirms a rating via enter |