- Plugins
- PIN Input
Plugins
Tailwind CSS PIN Input
A PIN Input plugin that allows to fill in data for inputs.
Installation
To get started, install PIN Input plugin via npm, else you can skip this step if you are already using Preline UI as a package.
npm i @preline/pin-input
Basic usage
Prefer to create your own style? Here is a completely unstylized example.
<div data-hs-pin-input>
<input type="text" data-hs-pin-input-item>
<input type="text" data-hs-pin-input-item>
<input type="text" data-hs-pin-input-item>
<input type="text" data-hs-pin-input-item>
</div>
Methods
The HSPinInput
object is contained within the global window
object
Destroy instance.
const { element } = HSPinInput.getInstance('#pin-input', true);
const destroyBtn = document.querySelector('#destroy-btn');
destroyBtn.addEventListener('click', () => {
element.destroy();
});
Events
When pin is filled example.
const el = HSPinInput.getInstance('#pin-input');
el.on('completed', ({currentValue}) => {...});
Demo examples
Looking for prebuilt UI components based on the Tailwind CSS? Preline UI packs hundreds of component examples for all your website needs.
Check out Preline UI Components