{"id":28329562,"url":"https://github.com/mrasterisco/passwordfield","last_synced_at":"2026-04-29T22:06:13.190Z","repository":{"id":83805042,"uuid":"592476316","full_name":"MrAsterisco/PasswordField","owner":"MrAsterisco","description":"A secure text field for SwiftUI with a button to toggle visibility.","archived":false,"fork":false,"pushed_at":"2023-02-12T21:16:51.000Z","size":124,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-18T17:44:55.978Z","etag":null,"topics":["password","securefield","swiftui","textfield"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/MrAsterisco.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2023-01-23T20:12:06.000Z","updated_at":"2024-03-25T11:05:08.000Z","dependencies_parsed_at":"2023-07-07T05:46:08.669Z","dependency_job_id":null,"html_url":"https://github.com/MrAsterisco/PasswordField","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/MrAsterisco/PasswordField","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrAsterisco%2FPasswordField","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrAsterisco%2FPasswordField/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrAsterisco%2FPasswordField/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrAsterisco%2FPasswordField/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrAsterisco","download_url":"https://codeload.github.com/MrAsterisco/PasswordField/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrAsterisco%2FPasswordField/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32445619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["password","securefield","swiftui","textfield"],"created_at":"2025-05-26T11:12:21.173Z","updated_at":"2026-04-29T22:06:13.185Z","avatar_url":"https://github.com/MrAsterisco.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PasswordField\n\nPasswordField is a SwiftUI view that allows users to toggle the visibility of the input in a secure field.\n\n![PasswordField](images/hero.png)\n\n## Installation\nPasswordField is available through [Swift Package Manager](https://swift.org/package-manager).\n\n```swift\n.package(url: \"https://github.com/MrAsterisco/PasswordField\", from: \"\u003csee GitHub releases\u003e\")\n```\n\n### Latest Release\nTo find out the latest version, look at the Releases tab of this repository.\n\n## Usage\nPasswordField works like a `SecureField`: you pass a `Binding\u003cString\u003e` while creating an instance. By default, it will automatically apply the correct style for the target platform.\n\n```swift\n@State private var password = \"\"\n\n// Default title: \"Password\"\nPasswordField(text: $password)\n\n// Custom title\nPasswordField(\"Your Password\", text: $password)\n```\n\n### Custom Visibility Control\nYou can customize the control the user uses to toggle the visibility of the input by passing a `@ViewBuilder` closure to the initializer. The closure will receive as only parameter a `Binding\u003cBool\u003e` which you should use with your custom view.\n\n```swift\n@State private var password = \"\"\n\nPasswordField(text: $password) { isInputVisible in\n  Picker(\"\", selection: isInputVisible) {\n    Text(\"Visible\")\n      .tag(true)\n    \n    Text(\"Hidden\")\n      .tag(false)\n  }\n}\n```\n### Modifiers\nYou can pass your own binding that will be used to control the input visibility:\n\n```swift\n@State private var password = \"\"\n@State private var isInputVisible = false\n\nPasswordField(text: $password)\n  .inputVisibile($isInputVisible)\n```\n\nYou can also customize the position of the input visibility control or hide it completely:\n\n```swift\n@State private var password = \"\"\n\nPasswordField(text: $password)\n  .visibilityControlPosition(.hidden) // or: .inlineInside, .inlineOutside, below\n```\n\nYou can also customize the text content type, for example to specify to the system that this is a new password:\n\n```swift\n@State private var password = \"\"\n\nPasswordField(text: $password)\n  // Possible values are defined in `UITextContentType`,\n  // `WKTextContentType` or `NSTextContentType`, depending\n  // on the target platform.\n  .textContentType(.newPassword)\n```\n\n## Platform Behaviors\nOn iOS and watchOS, the PasswordField will appear as a normal `SecureField` with a button to toggle the visibility of the input. \n\nOn macOS, a checkbox will be displayed below the field with the same purpose of the button.\n\ntvOS works differently with text input and, most of the times, users will most probably type with another device: for these reasons, **PasswordField is marked as unavailable on tvOS**.\n\n## Compatibility\nPasswordField requires **iOS 15.0 or later**, **macOS 12.0 or later**, and **watchOS 8.0** or later. It is **not** available on tvOS, although it can be referenced on multi-platform projects targeting **tvOS 13.0 or later**.\n\n## Contributions\nAll contributions to expand the library are welcome. Fork the repo, make the changes you want, and open a Pull Request.\n\nIf you make changes to the codebase, I am not enforcing a coding style, but I may ask you to make changes based on how the rest of the library is made.\n\n## Status\nThis library is under **active development**. Even if most of the APIs are pretty straightforward, **they may change in the future**; but you don't have to worry about that, because releases will follow [Semantic Versioning 2.0.0](https://semver.org/).\n\n## License\nComboPicker is distributed under the MIT license. [See LICENSE](https://github.com/MrAsterisco/PasswordField/blob/master/LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrasterisco%2Fpasswordfield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrasterisco%2Fpasswordfield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrasterisco%2Fpasswordfield/lists"}