@types/react-stars
@types/react-stars
npm i @types/react-stars
@types/react-stars

@types/react-stars

The repository for high quality TypeScript type definitions.

by DefinitelyTyped

2.2.1 (see all)License:MITTypeScript:Built-In
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.

Downloads/wk

38.8K

GitHub Stars

41K

LAST COMMIT

7mos ago

MAINTAINERS

1

CONTRIBUTORS

17,572

OPEN ISSUES

637

OPEN PRs

198
VersionTagPublished
2.2.1
latest
1yr ago
2.2.1
ts4.7
1yr ago
2.2.1
ts4.6
1yr ago
2.2.1
ts4.8
1yr ago
No alternatives found
No tutorials found
Add a tutorial

Rate & Review

100
No reviews found
Be the first to rate