pluralize-react
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Pluralize: React Component

Pluralization component for React.

Install

npm install --save pluralize-react

or

yarn add pluralize-react

Usage

Normal usage

<Pluralize count={5000} singular="Example" /> output: 5,000 Examples

Custom plural

<Pluralize count={5000} singular="Person" plural="People" /> output: 5,000 People

Zero Count

<Pluralize count={0} singular="Example" zero="No Examples" /> output: No Examples

Hide Count

<Pluralize count={0} singular="Example" showCount={false} /> output: Examples

Props

  • count: number;
  • singular: string;
  • plural?: string;
  • zero?: string;
  • className?: string;
  • showCount?: boolean;

Development

  • Clone the repo
  • yarn install
  • yarn storybook for preview

Readme

Keywords

none

Package Sidebar

Install

npm i pluralize-react

Weekly Downloads

30

Version

0.0.1

License

MIT

Unpacked Size

12.5 kB

Total Files

17

Last publish

Collaborators

  • fabricioflores