Render input to format a licenseplate
npm install --save react-format-licenseplate
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
-
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
At the moment only license plates from the Netherlands are supported, so this language is set by default
MIT © lennartkoelewijn