UNPKG

@coreui/react-pro

Version:

UI Components Library for React.js

71 lines (70 loc) 2.14 kB
import React, { HTMLAttributes } from 'react'; type Icon = { [key: number]: JSX.Element; }; export interface CRatingProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> { /** * The default icon to display when the item is selected. */ activeIcon?: string | JSX.Element | Icon; /** * Enables the clearing upon clicking the selected item again. */ allowClear?: boolean; /** * A string of all className you want applied to the component. */ className?: string; /** * Toggle the disabled state for the component. */ disabled?: boolean; /** * If enabled, only the currently selected icon will be visibly highlighted. */ highlightOnlySelected?: boolean; /** * The default icon to display when the item is not selected. */ icon?: string | JSX.Element | Icon; /** * Specifies the total number of stars to be displayed in the star rating component. This property determines the scale of the rating, such as out of 5 stars, 10 stars, etc. */ itemCount?: number; /** * The name attribute of the radio input elements. */ name?: string; /** * Execute a function when a user changes the selected element. */ onChange?: (value: number | null) => void; /** * Execute a function when a user hover the element. */ onHover?: (value: number | null) => void; /** * Minimum increment value change allowed. */ precision?: number; /** * Toggle the readonly state for the component. */ readOnly?: boolean; /** * Size the component small, large, or custom if you define custom icons with custom height. */ size?: 'sm' | 'lg' | 'custom'; /** * Enable tooltips with default values or set specific labels for each icon. */ tooltips?: boolean | string[]; /** * The `value` attribute of component. * * @controllable onChange * */ value?: number; } export declare const CRating: React.ForwardRefExoticComponent<CRatingProps & React.RefAttributes<HTMLDivElement>>; export {};