UNPKG

react-ts-rating-star

Version:

React TS Rating Star allows you to create a customizable rating star component with ease.

18 lines (17 loc) 1.13 kB
import React from 'react'; import type { RatingStarProps } from './types/types'; import './styles/react-ts-rating-star.css'; /** * RatingStar component for displaying a rating star system. * @param numberOfStars - The number of stars to display. * @param averageRating - The average rating to display. * @param iconColor - The color of the icon. Default is `gold`. * @param iconWidth - The width of the icon. Default is `2em`. * @param iconHeight - The height of the icon. Default is `2em`. * @param iconHoverEffect - The hover effect of the icon. Default is `none`. Allowed values: `none`, `scaling`, `rotating`, `animated-scaling`, `animated-twinkling` and `animated-rotating`. * @param backgroundColor - The background color of the star. Default is `darkgray`. * @param onClick - The callback function when a star is clicked. * @returns JSX.Element representing the RatingStar component. */ declare const RatingStar: ({ numberOfStars, averageRating, iconColor, iconWidth, iconHeight, iconHoverEffect, backgroundColor, onClick: clickCallback, }: RatingStarProps) => React.JSX.Element; export default RatingStar;