RatingInput
A rating input for forms: a star preview beside a dropdown.
import { RatingInput } from '@iffday/web/src/components';Example
The five stars on the left only preview the value; the dropdown on the right is the input, with No rating and half a star to five stars, 11 options. The stars cannot be clicked, which suits a form that submits the rating with other fields.
import { RatingInput } from '@iffday/web/src/components';
import { useState } from 'react';
export default function Example() {
const [steps, setSteps] = useState<number | null>(8);
return <RatingInput value={steps} onChange={setSteps} />;
}Usage
To rate by clicking stars on a film page, use StarRating. onChange receives half stars from 1 to 10, or null for No rating.
Props
RatingInput
apps/web/src/components.tsx:258| Prop | Type | Default |
|---|---|---|
value* | number | null | |
onChange* | (value: number | null) => void |