react-swedish-personal-identity-number-input
TypeScript icon, indicating that this package has built-in type declarations

0.4.3 • Public • Published

React Swedish personal identity number input

A higher order component for formatting values in input elements as Swedish personal identity numbers

Build Status NPM version

Install

$ npm install --save react-swedish-personal-identity-number-input

Usage

import React from 'react';
import { createSwedishPersonalIdentityNumberInput } from 'react-swedish-personal-identity-number-input';
 
const YourInputComponent = ({ innerRef, ...rest }) => {
  return <input ref={innerRef} {...rest} />;
}
 
const SwedishPersonalIdentityNumberInput = createSwedishPersonalIdentityNumberInput(YourInputComponent);
 
const Demo = () => {
  const [value, setValue] = React.useState();
 
  return <SwedishPersonalIdentityNumberInput value={value} onChange={setValue} />;
}

License

MIT © Jonathan Svenheden

/react-swedish-personal-identity-number-input/

    Package Sidebar

    Install

    npm i react-swedish-personal-identity-number-input

    Weekly Downloads

    2

    Version

    0.4.3

    License

    MIT

    Unpacked Size

    16.3 kB

    Total Files

    15

    Last publish

    Collaborators

    • jonathanp