Skip to content

Commit

Permalink
fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
hey-shrey committed Sep 11, 2022
1 parent 6dc71ba commit 2a42496
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

# 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.

# Install
``` bash
Expand All @@ -28,10 +28,10 @@ To view a demo online: <https://svelte-otp.netlify.app/>
To view demo examples locally clone the repo and run `npm install && npm run dev`

``` javascript
import SvelteOtp from 'svelte-otp';
import OtpInput from 'svelte-otp';

// main
<SvelteOtp
// main
<OtpInput
separator="-"
placeholder="0000"
...
Expand All @@ -41,7 +41,7 @@ import SvelteOtp from 'svelte-otp';
## Usage

``` html
<SvelteOtp
<OtpInput
separator="-"
placeholder="0000"
...
Expand All @@ -51,23 +51,23 @@ import SvelteOtp from 'svelte-otp';
***numberOfInputs* prop**

``` 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
...
autoFocusNextOnInput={true}
focusPreviousOnDelete={true}
Expand All @@ -77,11 +77,11 @@ import SvelteOtp from 'svelte-otp';
```html
let otpInstance: {getValue: () => void};
function handleClick() {
console.log('value on click',
console.log('value on click',
otpInstance?.getValue());
}
...
<SvelteOtp
<OtpInput
...
bind:this={otpInstance}
/>
Expand All @@ -95,7 +95,7 @@ function callbackFunction(event: CustomEvent) {
function handlePrefill() {
value = '123456';
}
<SvelteOtp
<OtpInput
...
bind:initialValue={value}
on:notify={callbackFunction}
Expand All @@ -111,7 +111,7 @@ function callbackFunction(event: CustomEvent) {
console.log('emittedValue', event.detail);
}

<SvelteOtp
<OtpInput
...
on:notify={callbackFunction}
...
Expand Down
4 changes: 2 additions & 2 deletions src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import SvelteOtp from "./Index.svelte";
import OtpInput from './Index.svelte';

export default SvelteOtp;
export default OtpInput;

0 comments on commit 2a42496

Please sign in to comment.