UNPKG

@neuctra/ui

Version:

A modern, responsive, customizable React UI component library powered by Tailwind CSS and Vite.

29 lines (28 loc) 1.22 kB
import { default as React } from 'react'; export interface RatingProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> { /** Current rating. Supports fractions when readOnly (e.g. 4.3). */ value?: number; defaultValue?: number; onChange?: (value: number) => void; /** Number of stars. */ max?: number; size?: "sm" | "md" | "lg"; readOnly?: boolean; disabled?: boolean; /** Clicking the current value again resets the rating to 0. */ allowClear?: boolean; label?: string; /** Show the numeric value next to the stars. */ showValue?: boolean; /** Color class of filled stars; defaults to the theme's warning (amber). */ colorClassName?: string; /** Applied to every star icon, in addition to size/color/state classes. */ starClassName?: string; /** The unfilled star color/class. */ emptyStarClassName?: string; /** The clickable wrapper around each star, in interactive mode. */ starWrapperClassName?: string; /** The numeric value shown when `showValue` is set. */ valueClassName?: string; } export declare const Rating: React.ForwardRefExoticComponent<RatingProps & React.RefAttributes<HTMLDivElement>>;