{"id":18541179,"url":"https://github.com/hadiuzzaman524/swiftpinput","last_synced_at":"2026-01-28T09:03:02.238Z","repository":{"id":261272439,"uuid":"883797196","full_name":"hadiuzzaman524/SwiftPinput","owner":"hadiuzzaman524","description":"SwiftPinput is a customizable SwiftUI component for OTP input fields, offering multiple styles, adjustable dimensions, colors, and a completion callback. Perfect for creating sleek, user-friendly OTP fields in iOS and macOS apps","archived":false,"fork":false,"pushed_at":"2024-11-05T16:17:00.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-30T02:33:21.777Z","etag":null,"topics":["otp-field","otp-verification","pinput","pinput-package","swift","swiftui","verification-code"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hadiuzzaman524.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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}},"created_at":"2024-11-05T15:33:38.000Z","updated_at":"2024-11-05T16:10:59.000Z","dependencies_parsed_at":"2024-11-05T17:33:56.527Z","dependency_job_id":null,"html_url":"https://github.com/hadiuzzaman524/SwiftPinput","commit_stats":null,"previous_names":["hadiuzzaman524/swiftpinput"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadiuzzaman524%2FSwiftPinput","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadiuzzaman524%2FSwiftPinput/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadiuzzaman524%2FSwiftPinput/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hadiuzzaman524%2FSwiftPinput/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hadiuzzaman524","download_url":"https://codeload.github.com/hadiuzzaman524/SwiftPinput/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250496214,"owners_count":21440227,"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","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":["otp-field","otp-verification","pinput","pinput-package","swift","swiftui","verification-code"],"created_at":"2024-11-06T20:04:03.889Z","updated_at":"2026-01-28T09:03:02.211Z","avatar_url":"https://github.com/hadiuzzaman524.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# SwiftPinput\n\n`SwiftPinput` is a customizable SwiftUI component for OTP (One-Time Password) input fields. This package allows you to add sleek, user-friendly OTP input fields to your iOS and macOS apps, with various styles and customization options.\n\n\nhttps://github.com/user-attachments/assets/c61d5a94-ab32-40c4-8d6b-1b44de84971b\n\n\n## Features\n\n- Support for different OTP field styles\n- Customizable field dimensions, colors, fonts, and corner radius\n- Built-in onCompletion callback for when OTP input is complete\n- Supports iOS 15.0+ and macOS 12.0+\n\n## Installation\n\nSwift Package Manager (SPM)\nTo install the ScrollableTabView using Swift Package Manager, follow these steps:\n\n1. Open your Xcode project.\n\n2. Go to File \u003e Add Packages.\n\n3. In the search bar, paste the following URL:\n\n```bash\nhttps://github.com/hadiuzzaman524/SwiftPinput.git\n\n```\n4. Select the package and click Add Package to integrate it into your project.\n## Usage\n\n### Basic Example\n\nHere’s a simple example of how to use `SwiftPinput` in your SwiftUI project:\n\n```swift\nimport SwiftUI\nimport SwiftPinput\n\nstruct ContentView: View {\n    @State private var otpCode = \"\"\n\n    var body: some View {\n        SwiftPinput(\n            otpCode: $otpCode,\n            onCompletion: { code in\n                print(\"OTP Code entered: \\(code)\")\n            }\n        )\n    }\n}\n```\n\n### Customizing the OTP Input Fields\n\nYou can customize `SwiftPinput` with various parameters:\n\n- **otpCode**: Binding to the OTP code entered by the user.\n- **otpCodeLength**: Sets the length of the OTP code (default is 4).\n- **fieldWidth** and **fieldHeight**: Set the width and height of each OTP input field.\n- **cornerRadius**: Sets the corner radius of the OTP fields.\n- **font**: Font for the OTP text.\n- **borderColor** and **activeBorderColor**: Colors for the field border in inactive and active states.\n- **inactiveBackgroundColor** and **activeBackgroundColor**: Background colors for the OTP fields in inactive and active states.\n- **textColor**: Color of the OTP text.\n- **style**: Style for the OTP input fields, supporting five styles (`style1`, `style2`, `style3`, `style4`, `style5`).\n- **onCompletion**: A callback that triggers once the OTP input is complete.\n\n### Style Options\n\nYou can choose from the following styles for OTP fields:\n\n- **style1**: Line at the bottom of the field.\n- **style2**: Rounded border around the field.\n- **style3**: No border, minimalistic style.\n- **style4**: Underline without rounded corners.\n- **style5**: Gradient background with a rounded border.\n\n#### Example with Customization\n\n```swift\nSwiftPinput(\n    otpCode: $otpCode,\n    otpCodeLength: 6,\n    fieldWidth: 50,\n    fieldHeight: 50,\n    cornerRadius: 10,\n    font: .title2,\n    borderColor: .gray,\n    activeBorderColor: .blue,\n    activeBackgroundColor: .blue.opacity(0.2),\n    inactiveBackgroundColor: .gray.opacity(0.1),\n    textColor: .primary,\n    style: .style2,\n    onCompletion: { code in\n        print(\"OTP entered: \\(code)\")\n    }\n)\n```\n\n## Requirements\n\n- iOS 15.0+ or macOS 12.0+\n- Swift 5.5+\n\n## License\n\nThis package is available under the MIT license. See the LICENSE file for more info.\n\n--- \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhadiuzzaman524%2Fswiftpinput","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhadiuzzaman524%2Fswiftpinput","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhadiuzzaman524%2Fswiftpinput/lists"}