{"id":19809494,"url":"https://github.com/space-code/floating-text-field","last_synced_at":"2025-02-28T12:45:00.340Z","repository":{"id":201023764,"uuid":"703352851","full_name":"space-code/floating-text-field","owner":"space-code","description":"A customizable floating text field written in SwiftUI","archived":false,"fork":false,"pushed_at":"2023-10-18T16:47:34.000Z","size":582,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-02-11T11:42:56.412Z","etag":null,"topics":["floating-textfield","swift","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/space-code.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-10-11T04:56:34.000Z","updated_at":"2025-02-07T20:39:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"95a34d65-ed66-4bd3-889a-1ff30ccb0a4d","html_url":"https://github.com/space-code/floating-text-field","commit_stats":null,"previous_names":["space-code/floating-text-field"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-code%2Ffloating-text-field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-code%2Ffloating-text-field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-code%2Ffloating-text-field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/space-code%2Ffloating-text-field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/space-code","download_url":"https://codeload.github.com/space-code/floating-text-field/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241152740,"owners_count":19918674,"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":["floating-textfield","swift","swiftui","textfield"],"created_at":"2024-11-12T09:17:11.911Z","updated_at":"2025-02-28T12:45:00.319Z","avatar_url":"https://github.com/space-code.png","language":"Swift","readme":"![FloatingTextField: A Customizable Text Field](https://raw.githubusercontent.com/space-code/floating-text-field/dev/Resources/floating-text-field.png)\n\n\u003ch1 align=\"center\" style=\"margin-top: 0px;\"\u003efloating-text-field\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/space-code/floating-text-field/blob/main/LICENSE\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/space-code/floating-text-field?style=flat\"\u003e\u003c/a\u003e \n\u003ca href=\"https://developer.apple.com/\"\u003e\u003cimg alt=\"Platform\" src=\"https://img.shields.io/badge/platform-ios-%23989898\"/\u003e\u003c/a\u003e \n\u003ca href=\"https://developer.apple.com/swift\"\u003e\u003cimg alt=\"5.7\" src=\"https://img.shields.io/badge/language-Swift5.7-orange.svg\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/space-code/floating-text-field\"\u003e\u003cimg alt=\"CI\" src=\"https://github.com/space-code/floating-text-field/actions/workflows/ci.yml/badge.svg?branch=main\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/apple/swift-package-manager\" alt=\"floating-text-field on Swift Package Manager\" title=\"floating-text-field on Swift Package Manager\"\u003e\u003cimg src=\"https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://codecov.io/gh/space-code/floating-text-field\"\u003e\u003cimg alt=\"CodeCov\" src=\"https://codecov.io/gh/space-code/floating-text-field/graph/badge.svg?token=lA8TWRHGkf\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Description\n`floating-text-field` is a customizable text field.\n\n- [Visual Example](#visual-example)\n- [Usage](#usage)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Communication](#communication)\n- [Contributing](#contributing)\n- [Author](#author)\n- [License](#license)\n\n## Visual Example\n\nThe visual example of the `FloatingTextField`:\n\n![Example](Resources/examples/example.gif)\n\n## Usage\n\n### Basic Usage\n\nFor basic usage, simply import the `FloatingTextField` package and set the text field height as follows:\n\n```swift\nimport FloatingTextField\n\nstruct ContentView: View {\n    @State private var username: String = \"\"\n\n    var body: some View {\n        FloatingTextFieldView($username, placeholder: \"username\")\n            .frame(height: 60.0)\n    }\n}\n```\n\n### Custom Fonts and Colors\n\nThe `FloatingTextField` provides an opportunity to customize text font, text color, placeholder font, placeholder color, and more.\n\n```swift\nimport FloatingTextField\n\nstruct ContentView: View {\n    @State private var username: String = \"\"\n\n    var body: some View {\n        FloatingTextFieldView($username, placeholder: \"username\")\n            .font(Font.system(size: 17.0))\n            .placeholderFont(Font.system(size: 14.0))\n            .textColor(.black)\n            .placeholderColor(.gray)\n            .frame(height: 60.0)\n    }\n}\n```\n\n### Custom Styles\n\nYou can create a text field style in two simple steps.\n\n1. Define a custom text field style as follows:\n\n```swift\nimport FloatingTextField\n\nstruct CustomTextFieldStyle: FloatingTextFieldStyle {\n    func body(content: FloatingTextField) -\u003e FloatingTextField {\n        content\n            .font(Font.system(size: 17.0))\n            .placeholderFont(Font.system(size: 14.0))\n            .cornerRadius(12)\n            .placeholderBottomPadding(4.0)\n            .textColor(.black)\n            .placeholderColor(.gray)\n            .borderWidth(1)\n            .borderColor(.black)\n    }\n}\n```\n\n2. Apply this style using `textFieldStyle(_:)`:\n\n```swift\nstruct ContentView: View {\n    @State private var username: String = \"\"\n\n    var body: some View {\n        FloatingTextFieldView($username, placeholder: \"username\")\n            .textFieldStyle(style: CustomTextFieldStyle())\n            .frame(height: 60.0)\n    }\n}\n```\n\n### Secure Text Entry\n\nThe `FloatingTextField` can conceal sensitive data such as passwords. You can hide it by using the `isSecureTextEntry(_:)` modifier.\n\n```swift\nimport FloatingTextField\n\nstruct ContentView: View {\n    @State private var password: String = \"\"\n    @State private var isPasswordHidden: Bool = true\n\n    var body: some View {\n        FloatingTextField($password, placeholder: \"Password\")\n            .textFieldStyle(style: CustomTextFieldStyle())\n            .isSecureTextEntry(isPasswordHidden)\n            .leftView {\n                Image(systemName: \"lock\")\n                    .foregroundColor(.gray)\n            }\n            .rightView {\n                Button(\n                    action: { isPasswordHidden.toggle() },\n                    label: {\n                        Image(systemName: \"eye.fill\")\n                            .foregroundColor(.gray)\n                    }\n                )\n            }\n            .frame(height: 60.0)\n    }\n}\n```\n\n## Requirements\n\n- iOS 15.0+\n- Xcode 14.0\n- Swift 5.7\n\n## Installation\n### Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It is in early development, but `floating-text-field` does support its use on supported platforms.\n\nOnce you have your Swift package set up, adding `floating-text-field` as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/space-code/floating-text-field.git\", .upToNextMajor(from: \"1.0.0\"))\n]\n```\n\n## Communication\n- If you **found a bug**, open an issue.\n- If you **have a feature request**, open an issue.\n- If you **want to contribute**, submit a pull request.\n\n## Contributing\nBootstrapping development environment\n\n```\nmake bootstrap\n```\n\nPlease feel free to help out with this project! If you see something that could be made better or want a new feature, open up an issue or send a Pull Request!\n\n## Author\nNikita Vasilev, nv3212@gmail.com\n\n## License\nfloating-text-field is available under the MIT license. See the LICENSE file for more info.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspace-code%2Ffloating-text-field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspace-code%2Ffloating-text-field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspace-code%2Ffloating-text-field/lists"}