@withmantle/react-number-format
v5.5.0
Published
React component to format number in an input or as a text.
Downloads
97
Readme
@withmantle/react-number-format
React Number Format is an input-formatter library with a sophisticated and light weight caret engine. It ensures that a user can only enter text that meets specific numeric or string patterns, and formats the input value for display.
Note: This is a TenKeyLabs fork of s-yadav/react-number-format, published as
@withmantle/react-number-format.
Features
- Prefix, suffix and thousands separator.
- Input Masking.
- Format number in an input or format as a simple text.
- Custom pattern formatting.
- Custom formatting handler.
- Fully customizable
Install
Using npm
npm install @withmantle/react-number-formatUsing yarn
yarn add @withmantle/react-number-formatUsage
Numeric Format
import { NumericFormat } from '@withmantle/react-number-format';Pattern Format
import { PatternFormat } from '@withmantle/react-number-format';Documentation
See the upstream documentation for full API reference:
Development
- Clone the repository
nvm useto switch to the correct Node versionyarnto install dependenciesyarn startto run example server (http://localhost:8084/)yarn testto run tests (vitest)yarn build-cito build dist and type declarations
Releasing
This project uses changesets to manage versioning and npm releases.
- When making a change that should be released, add a changeset:
npx changeset add - Select the semver bump type (patch / minor / major) and describe the change.
- Commit the generated
.changeset/*.mdfile along with your code changes. - When your PR merges to
master, the CD workflow will either:- Open (or update) a Version Packages PR that bumps versions and updates changelogs, or
- Publish to npm if the Version Packages PR has already been merged.
