1.0.2 • Published 3 years ago
react-format-licenseplate v1.0.2
react-format-licenseplate
Render input to format a licenseplate
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 stateonChange
- callback function for handling the changed inputselectOnClick
- 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