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

1.0.2 • Public • Published

react-format-licenseplate

Render input to format a licenseplate

NPM JavaScript Style Guide

Install

npm install --save react-format-licenseplate

Usage

import React, { useState } from 'react'

// Libraries
import ReactLicenseplate from 'react-format-licenseplate'

const App = () => {
  const [licenseplate, setLicenseplate] = useState('')

  return (
    <ReactLicenseplate 
      value={licenseplate}
      onChange={newValue => {
        setLicenseplate(newValue)
      }}
      selectOnClick={true}
    />
  )
}

export default App

Props

  • value - value to store in state
  • onChange - callback function for handling the changed input
  • selectOnClick - true for selecting the text on focus and false for default behaviour

Language support

At the moment only license plates from the Netherlands are supported, so this language is set by default

License

MIT © lennartkoelewijn

Package Sidebar

Install

npm i react-format-licenseplate

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

17 kB

Total Files

9

Last publish

Collaborators

  • lennartkoelewijn