{"id":15093269,"url":"https://github.com/swaraj55/otp-input","last_synced_at":"2025-07-21T16:33:08.567Z","repository":{"id":251534378,"uuid":"836523012","full_name":"Swaraj55/otp-input","owner":"Swaraj55","description":"ngx-otp-code-input is a simple Angular component for entering and validating OTP codes. It supports custom lengths, masking, integer-only input, and visual status indicators, making it easy to add OTP functionality to your forms.","archived":false,"fork":false,"pushed_at":"2025-06-29T13:53:31.000Z","size":831,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-29T14:36:52.457Z","etag":null,"topics":["angular","angular-cli","angular8","input","javascript","one-time-password","otp","typescript","web"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ngx-otp-code-input","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Swaraj55.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-01T03:12:12.000Z","updated_at":"2025-06-29T13:53:34.000Z","dependencies_parsed_at":"2024-08-27T20:53:37.004Z","dependency_job_id":null,"html_url":"https://github.com/Swaraj55/otp-input","commit_stats":null,"previous_names":["swaraj55/otp-input"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Swaraj55/otp-input","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swaraj55%2Fotp-input","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swaraj55%2Fotp-input/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swaraj55%2Fotp-input/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swaraj55%2Fotp-input/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Swaraj55","download_url":"https://codeload.github.com/Swaraj55/otp-input/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swaraj55%2Fotp-input/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266334543,"owners_count":23913002,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angular-cli","angular8","input","javascript","one-time-password","otp","typescript","web"],"created_at":"2024-09-25T11:20:26.852Z","updated_at":"2025-07-21T16:33:08.520Z","avatar_url":"https://github.com/Swaraj55.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ngx-otp-code-input\n\nngx-otp-code-input is an Angular component for OTP (One-Time Password) input. This component is highly customizable, allowing for various configurations such as masking, integer-only input, autofocus, and more.\n\nIf you like the library, please consider giving it a ⭐ on GitHub.\n\n\n## Features\n\n- Customizable Length: Specify the number of OTP input fields.\n- Masking: Hide input values, useful for password-like behavior.\n- Integer Only: Restrict input to only integers.\n- Autofocus: Automatically focus on the first input field.\n- Read-only and Disabled States: Make the input fields read-only or disabled.\n- Tab Index: Control tab navigation between input fields.\n- Events: Emit events on OTP change and completion.\n- Success/Error Status Feedback: Visually indicate the result of OTP verification with customizable icons and colors.\n- Animated Transitions: Smooth transitions or animations when focusing between OTP input fields.\n\n\n## Installation\n\nInstall the package via npm:\n\n```bash\n  npm install ngx-otp-code-input\n```\n    \n## Usage\n\n#### Import the Module\nAdd **NgxOtpCodeInputModule** to your Angular module:\n```javascript\nimport { NgxOtpCodeInputModule } from 'ngx-otp-code-input';\n\n@NgModule({\n  declarations: [\n    // your components\n  ],\n  imports: [\n    // other modules\n    NgxOtpCodeInputModule\n  ],\n  providers: [],\n  bootstrap: [AppComponent]\n})\nexport class AppModule { }\n\n```\n\n#### Use the Component in Your Template\n\nAdd the **ngx-otp-code-input** component to your template:\n\n```javascript\n\u003cngx-otp-code-input\n  [length]=\"6\"\n  [mask]=\"false\"\n  [integerOnly]=\"false\"\n  [disabled]=\"false\"\n  variant=\"outline\"\n  [readonly]=\"false\"\n  [autofocus]=\"true\"\n  [animationConfig]=\"{ type: 'slide', duration: '1.0s' }\" \u003c!-- Optional: Configure animations --\u003e\n  [status]=\"otpStatus\" \u003c!-- Bind this to a variable in your component --\u003e\n  [successIcon]=\"'check_circle'\" \u003c!-- Optional: Bind to a custom icon for success --\u003e\n  [failureIcon]=\"'cancel'\" \u003c!-- Optional: Bind to a custom icon for failure --\u003e\n  [tabIndex]=\"true\"\n  (otpChange)=\"onOtpChange($event)\"\n  (otpComplete)=\"onOtpComplete($event)\"\n\u003e\u003c/ngx-otp-code-input\u003e\n\n```\n\n#### Handle Events in Your Component\n\nAdd event handlers in your component:\n\n```javascript\nexport class AppComponent {\n  otpStatus: 'success' | 'failed' | null = null;\n\n  onOtpComplete(event: string): void {\n    console.log('OTP Complete:', event);\n  }\n\n  onOtpChange(event: string): void {\n    console.log('OTP Change:', event);\n  }\n}\n\n```\n## Configuration\n\n#### Inputs\n\n| Input     | Type     | Default   |   Description          |\n| :-------- | :------- | :-------- | :----------------------|\n| `length`  | `number` | **4**     | Number of OTP input fields.     |\n| `mask`  | `boolean` | **false**     | Hide the input values (like a password field).|\n| `integerOnly`  | `boolean` | **false** | Restrict input to only integer values.|\n| `disabled`  | `boolean` | **false**     | Disable the input fields.|\n| `readonly`  | `boolean` | **false**     | Make the input fields read-only.|\n| `autofocus`  | `boolean` | **true**     | Automatically focus on the first input field.|\n| `tabIndex`  | `boolean` | **false**     | Enable tab navigation between input fields.|\n| `inputClass`  | `string` | **''**     | Custom CSS class for the input fields.|\n| `variant`  | `MatFormFieldAppearance` | **'outline', 'fill'**     | Appearance of the Material form field.|\n| `regex`  | `string` | **''**     | Custom regex pattern for the input fields.|\n| `status` | `any` | **null**   | Visual status of OTP verification.|\n| `successIcon`  | `string` | **'check_circle'**     | Custom icon for success status.|\n| `failureIcon`  | `string` | **'error'**     | Custom icon for failure status.|\n| `animationConfig`  | `{ type: string, duration: string }` | **{ type: 'slide', duration: '1.0s' }**     | Configuration for animations when focusing between input fields.|\n\n\n#### Outputs\n\n\n| Output | Type     | Description                       |\n| :-------- | :------- | :-------------------------------- |\n| `otpChange`      | `EventEmitter\u003cstring\u003e` | Emits the current OTP value when it changes |\n| `otpComplete`      | `EventEmitter\u003cstring\u003e` | Emits the OTP value when all fields are filled. |\n\n\n## Contributing\n\nContributions are welcome! Please submit a pull request or open an issue to discuss changes. 🚀\n\n\n## License\n\n[MIT](https://github.com/Swaraj55/otp-input/blob/master/LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswaraj55%2Fotp-input","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswaraj55%2Fotp-input","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswaraj55%2Fotp-input/lists"}