Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svelte-otp

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-otp - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

.codecov.yml

3

package.json
{
"name": "svelte-otp",
"version": "1.0.1",
"version": "1.0.2",
"description": "svelte Otp",

@@ -47,2 +47,3 @@ "type": "module",

"babel-jest": "^29.0.2",
"coveralls": "^3.1.1",
"cssnano": "^5.1.13",

@@ -49,0 +50,0 @@ "cz-conventional-changelog": "^3.3.0",

# Svelte Otp
# Svelte Otp
[![Build Status](https://app.travis-ci.com/shubhadip/svelte-otp.svg?branch=main)](https://app.travis-ci.com/shubhadip/svelte-otp)
[![codecov](https://codecov.io/gh/shubhadip/svelte-otp/branch/main/graph/badge.svg?token=P95PBOGESX)](https://codecov.io/gh/shubhadip/svelte-otp)
[![Netlify Status](https://api.netlify.com/api/v1/badges/01cc3b58-429a-41d5-b1d4-f96641a3245f/deploy-status)](https://app.netlify.com/sites/svelte-otp/deploys)
A Otp Component that can be used with Svelte.
A Otp Component that can be used with Svelte.

@@ -27,6 +31,6 @@ # Install

``` javascript
import SvelteOtp from 'svelte-otp';
import OtpInput from 'svelte-otp';
// main
<SvelteOtp
// main
<OtpInput
separator="-"

@@ -41,3 +45,3 @@ placeholder="0000"

``` html
<SvelteOtp
<OtpInput
separator="-"

@@ -52,19 +56,19 @@ placeholder="0000"

``` html
<SvelteOtp numberOfInputs={6} />
<OtpInput numberOfInputs={6} />
```
***numberOfInputs* along with *separator*prop**
``` html
<SvelteOtp numberOfInputs={4} separator="-" />
<OtpInput numberOfInputs={4} separator="-" />
```
**Using *numberOfInputs*, *separator* and *placeholder* props**
``` html
<SvelteOtp separator="-" placeholder="******" numberOfInputs={6} />
<OtpInput separator="-" placeholder="******" numberOfInputs={6} />
```
**Masking Input**
``` html
<SvelteOtp separator="-" placeholder="****" numberOfInputs={4} maskInput={true} />
<OtpInput separator="-" placeholder="****" numberOfInputs={4} maskInput={true} />
```
**Change Focus on Input/Delete**
``` html
<SvelteOtp
<OtpInput
...

@@ -79,7 +83,7 @@ autoFocusNextOnInput={true}

function handleClick() {
console.log('value on click',
console.log('value on click',
otpInstance?.getValue());
}
...
<SvelteOtp
<OtpInput
...

@@ -98,3 +102,3 @@ bind:this={otpInstance}

}
<SvelteOtp
<OtpInput
...

@@ -115,3 +119,3 @@ bind:initialValue={value}

<SvelteOtp
<OtpInput
...

@@ -134,3 +138,8 @@ on:notify={callbackFunction}

| focusPreviousOnDelete | Boolean | true | move focus to previous element on delete |
| emitEventOnPrefill | Boolean | false | emits events on filling all input fields |
| customWrapperClass | string | false | used to style wrapper element of otp |
| customSeparatorClass | string | | used to style separator |
| customRowClass | string | | used to style individual input |
| customInputWrapperClass | string | | used to style input wrapper |
| customTextInputClass | string | | used to style input box |
| emitEventOnPrefill | string | | emits events on filling all input fields |

@@ -137,0 +146,0 @@ ## Events

@@ -1,3 +0,3 @@

import SvelteOtp from "./Index.svelte";
import OtpInput from './Index.svelte';
export default SvelteOtp;
export default OtpInput;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc