{"id":18103611,"url":"https://github.com/fcanas/tokenfield","last_synced_at":"2025-10-11T21:38:32.683Z","repository":{"id":46644412,"uuid":"408549072","full_name":"fcanas/TokenField","owner":"fcanas","description":"SwiftUI wrapper for NSTokenField","archived":false,"fork":false,"pushed_at":"2021-10-29T01:14:05.000Z","size":11,"stargazers_count":20,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T17:12:50.872Z","etag":null,"topics":["macos","swift","swift-package","swift-package-manager","swiftui","swiftui-components"],"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/fcanas.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}},"created_at":"2021-09-20T18:02:24.000Z","updated_at":"2025-03-22T13:19:02.000Z","dependencies_parsed_at":"2022-09-17T08:00:15.708Z","dependency_job_id":null,"html_url":"https://github.com/fcanas/TokenField","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcanas%2FTokenField","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcanas%2FTokenField/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcanas%2FTokenField/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fcanas%2FTokenField/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fcanas","download_url":"https://codeload.github.com/fcanas/TokenField/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248766953,"owners_count":21158356,"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":["macos","swift","swift-package","swift-package-manager","swiftui","swiftui-components"],"created_at":"2024-10-31T22:12:41.967Z","updated_at":"2025-10-11T21:38:27.621Z","avatar_url":"https://github.com/fcanas.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TokenField\n\nA SwiftUI wrapper for `NSTokenField`\n\n```swift\nstruct MyToken {\n    var title: String\n}\n\nstruct TestView: View {\n    @State var tokens: [MyToken]\n    var body: some View {\n        VStack {\n            TokenField($tokens, { $0.title })\n        }\n    }\n}\n```\n\n`TokenField` takes a `Binding` to a `RandomAccessCollection` of\nelements to use as its tokens. When the token type does not conform \nto `StringProtocol`, it also requires a closure to convert tokens to \na `String`.\n\n```swift\nstruct TestIdentifiableStringsView: View {\n    @State var tokens: [String]\n    var body: some View {\n        VStack {\n            TokenField($tokens)\n        }\n    }\n}\n```\n\n`FormTokenField` can be used within a `Form` view and be given a\nlabel that will align with standard `Form` labels.\n\n```swift\nstruct TestFormsView: View {\n    @State var tokens: [MyToken]\n    @State var strings: [String]\n    var body: some View {\n        Form {\n            FormTokenField(title:\"Tokens\", $tokens, { $0.title })\n            FormTokenField({ Text(\"Tokens\") }, $strings)\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffcanas%2Ftokenfield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffcanas%2Ftokenfield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffcanas%2Ftokenfield/lists"}