@types/react-stars

@types/react-stars

npm i @types/react-stars

Readme

Installation

npm install --save @types/react-stars

Summary

This package contains type definitions for react-stars (https://github.com/n49/react-stars).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-stars.

index.d.ts

// Type definitions for react-stars 2.2
// Project: https://github.com/n49/react-stars
// Definitions by: TingYuLC <https://github.com/TingYuLC>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.6

import * as React from "react";

interface ReactStarsProps {
  /** Name of parent class */
  className?: string | undefined;

  /** How many total stars you want */
  count?: number | undefined;

  /** Set rating value */
  value?: number | undefined;

  /** Which character you want to use as a star */
  char?: string | undefined;

  /** Color of inactive star (this supports any CSS valid value) */
  color1?: string | undefined;

  /** Color of selected or active star */
  color2?: string | undefined;

  /** Size of stars (in px) */
  size?: number | undefined;

  /** Should you be able to select rating or just see rating (for reusability) */
  edit?: boolean | undefined;

  /** Should component use half stars, if not the decimal part will be dropped otherwise normal algebra rools will apply to round to half stars */
  half?: boolean | undefined;

  /** Will be invoked any time the rating is changed */
  onChange?: ((new_rating: number) => void) | undefined;
}

declare class ReactStars extends React.Component<ReactStarsProps> {}

export default ReactStars;

Additional Details

  • Last updated: Thu, 08 Jul 2021 22:41:35 GMT
  • Dependencies: @types/react
  • Global values: none

Credits

These definitions were written by TingYuLC.

Jump To