0.3.1 • Published 1 year ago

react-ordinals v0.3.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

React Ordinals

npm version

license

React Ordinals is a package used to get number ordinals in react apps

Installation

Install the package using npm:

npm install react-ordinals

Install the package using yarn:

yarn add react-ordinals

Install the package using bun:

bun add react-ordinals

Usage

Here's a basic example of how to use react-ordinals:

import React from "react";
import { WordOrdinal } from "react-ordinals";

const App = () => {
  const numberRange = Array.from({length: 50}, (_, index) => index + 1);
  return (
    <section>
      {numberRange.map((number) => (
        <WordOrdinal
          number={number}
          shouldBeTitleCase={true}
        />  
      ))}
    </section>
  );
};

export default App;

API

WordOrdinal

The WordOrdinal component is responsible for converting numbers into their ordinal form.

Props:

  • number (required): The number to be converted into an ordinal form.
  • shouldBeTitleCase (required): A boolean indicating whether the result should be in title

Examples

Example 1: Word Ordinal

const App = () => {
  return (
    <section>
      <WordOrdinal
        number={14}
        shouldBeTitleCase={false}
      />  
    </section>
  );
};

Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

0.3.1

1 year ago

0.3.0

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago