v0.1 public beta early access on GitHub
Home / Components / rating

RatingiOS

Animated star rating with tap or drag input, optional half-star precision, spring scale feedback, and selection haptics

$ npx lumioui add rating
import { Rating } from "@/components/ui/rating/rating";
Ratingrating.tsx
rating/rating.tsx open

Live preview — the real component, driven by the props below.

Props9
value? number Controlled rating, 0..max (0.5 steps when allowHalf).
defaultValue? number Uncontrolled initial rating. Default 0.
onChange? (value: number) => void
max? number Number of stars. Default 5.
size? number Star size in px. Default 32.
allowHalf? boolean Allow half-star precision. Default false.
readonly? boolean Display-only — still announces the rating, removes the input role.
disabled? boolean Non-interactive input — keeps the adjustable role but ignores touches and dims the row (distinct from readonly, which is pure display).
className? string
Rating — Interactiveinteractive.tsx
rating/variants/interactive.tsx open

Animated star rating with tap or drag input, optional half-star precision, spring scale feedback, and selection haptics

Rating — Readonlyreadonly.tsx
rating/variants/readonly.tsx open

Animated star rating with tap or drag input, optional half-star precision, spring scale feedback, and selection haptics