svelte-otp-input

Svelte Otp Input

svelte-otp-inputs

one-time password input component for the web built with svelte.

Installation

Install my-project with npm

 npm i svelte-otp-inputs

Usage/Examples


 <script type="ts">
    import OTPInput from 'svelte-otp-inputs';
    let otpNumber = ''
    const getOtp = (otp, paste)=>{ 
        otpNumber = otp;
    }

 </script>
 <OTPInput  setOtp={getOtp} otpCount={6} wrapperStyle={"background:white;"} inputStyle={"color:gray;"}/>

Props

Name Type Required Default
setOtp Function true -
otpCount number false 6
wrapperStyle String false ""
inputStyle String false ""

Top categories

Loading Svelte Themes