1.0.2 • Published 3 years ago

react-format-licenseplate v1.0.2

Weekly downloads
14
License
MIT
Repository
github
Last release
3 years ago

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