Rating
Star rating input and display.
Installation
bun add @xerobi/ui
import { Rating } from "@xerobi/ui/rating"This component is client-side. In Astro, hydrate it with a client directive.
Examples
Default
import { Rating } from "@xerobi/ui/rating"
export function RatingDefault() {
return <Rating defaultValue={3} />
}Read only
import { Rating } from "@xerobi/ui/rating"
export function RatingReadOnly() {
return <Rating value={4} readOnly />
}API reference
Rating
| Prop | Type | Description |
|---|---|---|
| value | number | |
| defaultValue | number | |
| max | number | |
| readOnly | boolean | |
| disabled | boolean | |
| size | "small" | "medium" | "large" | |
| onChange | (value: number) => void |
Styling hooks: [data-slot="rating"].